Nick Coghlan wrote:

> I'm also trying to figure out why you would ever write:
>    [a, b, c, d] = seq

I think the ability to use square brackets is a
holdover from some ancient Python version where you had
to match the type of the thing being unpacked with
the appropriate syntax on the lhs. It was a silly
requirement from the beginning, and it became
unworkable as soon as things other than lists and
tuples could be unpacked.

In Py3k I expect that [...] for unpacking will
no longer be allowed.

> Indeed. It's a (minor) pain that optional flag variables and variable length 
> argument lists are currently mutually exclusive. Although, if you had that 
> rule, I'd want to be able to write:
> 
>    def f(a, b, *, foo=1, bar=2): pass

Yes, I agree.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,          | A citizen of NewZealandCorp, a       |
Christchurch, New Zealand          | wholly-owned subsidiary of USA Inc.  |
[EMAIL PROTECTED]          +--------------------------------------+
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to