Georg Brandl <ge...@python.org> added the comment: > I disagree with calling only nonlocal variables but not module variables > 'free'. As I quoted from Wikipedia, that restrictive definition is not > agree on by all at all.
But it is the definition that Python uses, at least in the code. I agree that the usage of "free variable" in the reference manual is inconsistent; this should be fixed independently. > Python does not treat top-level or recursive function names specially in > the way meant above. It does treat them differently: they are globals, not free variables. > I used 'nonlocal' specifically because the behavior of locals() seemed > by my testing to be concordant with the behavior of the 'nonlocal' > statement, which rejects the globals that locals does not print. What > do you mean by 'clash'? "nonlocal" variables could be mistaken as variables that are declared as nonlocal by such a statement. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6925> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com