boblatest, 27.11.2009 13:18: > Here's my question: Given a list of onknown length, I'd like to be > able to do the following: > > (a, b, c, d, e, f) = list > > If the list has fewer items than the tuple, I'd like the remaining > tuple elements to be set to "None". If the list is longer, I'd like > the excess elements to be ignored.
What about this: fillUp = [None] * 6 (a, b, c, d, e, f) = (list + fillUp)[:6] Stefan -- http://mail.python.org/mailman/listinfo/python-list