Greg Ewing wrote:
> 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.
>   

Sorry about the "mee to" post, but me too: +1 on no assignment allowed. 
I can't think of any way to do it that would be intuitive and obvious to 
*most* people and wouldn't require a separate FAQ entry besides the one 
that explains 'global' and 'nonlocal.'

Neil

_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to