Am 22.12.2011 00:48 schrieb Steven D'Aprano:
On Wed, 21 Dec 2011 18:20:16 -0500, Dennis Lee Bieber wrote:
For the amount of typing, it's easier to just do a straight line
tuple unpack
a,b,c = ([],[],[])
Note that tuples are created by the comma, not the round brackets (or
parentheses for any Americans reading). So the round brackets there are
strictly redundant:
a, b, c = [], [], []
The only times you need the brackets around a tuple is to control the
precedence of operations, or for an empty tuple.
IBTD:
a=((a, b) for a, b, c in some_iter)
b=[(1, c) for <whatever>]
Without the round brackets, it is a syntax error.
Thomas
--
http://mail.python.org/mailman/listinfo/python-list