[Python-3000] Draft PEP for outer scopes

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Nov 4 02:11:55 CET 2006


Ka-Ping Yee wrote:

>     nonlocal x = y = 0
> 
> is equivalent to
> 
>     nonlocal x; x = y = 0

This is far from obvious. And what happens if
you want both x and y to be nonlocal? Can you
write

   nonlocal x = nonlocal y = 0

If so, this is getting even more complicated
for very little benefit.

> The point is to make the statement easy to explain.

It's even easier to explain if assignment isn't
allowed at all.

--
Greg


More information about the Python-3000 mailing list