Mike Meyer <[EMAIL PROTECTED]> wrote: ... > concept of tuple unpacking. When names are bound, you can use a > "tuple" for an lvalue, and the sequence on the rhs will be "unpacked" > into the various names in the lvalue: > > for key, value = mydict.iteritems(): ... > a, (b, c) = (1, 2), (3, 4) > > I think of the parameters of a function as just another case of > this; any solution that works for the above two should work for > function paremeters as well.
I agree that conceptually the situations are identical, it's just that currently using [ ] on the left of an equal sign is OK, while using them in a function's signature is a syntax error. No doubt that part of the syntax could be modified (expanded), I imagine that nothing bad would follow as a consequence. Alex -- http://mail.python.org/mailman/listinfo/python-list