On Thu, 2 Nov 2006, Christian Tanzer wrote:
> As you allow
>
> nonlocal x, y, z
>
> and
>
> x, y, z = 1, 2, 3
>
> is legal Python (and does the right thing), why not allow
>
> nonlocal x, y, z = 1, 2, 3
>
> too?
>
> That's one less rule needed to be learned and enforced.
I suppose that's fine. Also i guess
nonlocal x = y = 0
seems okay. We have to be clear that you can't assign to anything
that you could in a normal assignment though -- e.g.:
nonlocal foo.bar, a[5] = 1, 2
is not allowed.
I've updated the PEP to allow multiple assignment and to specify
the exact grammar of the "nonlocal" statement.
http://zesty.ca/python/pep-3104.html
-- ?!ng
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com