Re: [Python-ideas] Unify global and nonlocal
24 Feb
2014
24 Feb
'14
10:17 a.m.
On Mon, Feb 24, 2014 at 4:22 AM, Saket Dandawate
Also why can't it be like this too
global x = 3
rather than only
global x x=3
I can't find the discussion thread, but originally PEP3104 proposed this kind of syntax for nonlocal, but it was never actually implemented because of ambiguity with the unpacking assignment case: nonlocal x, y, z = 1, 2, 3 Does this mean that x, y and z are non locals? or just x? Now I understand the differences between nonlocal and global. But still is not very clear for me why nonlocal can't access the global module namespace as well, not to be used in the same way as global, but to access names already defined in the global namespace. Manuel.
3686
Age (days ago)
3686
Last active (days ago)
1 comments
2 participants
participants (2)
-
Manuel Cerón
-
Nick Coghlan