This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients georg.brandl, orsenthil, siona, terry.reedy
Date 2009-09-18.22:37:49
SpamBayes Score 4.5113436e-05
Marked as misclassified No
Message-id <1253313471.59.0.560578642744.issue6925@psf.upfronthosting.co.za>
In-reply-to
Content
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.  From The Free On-line Dictionary of Computing,
"1. A variable referred to in a function, which is not an argument of
the function. In lambda-calculus, x is a bound variable in the term M =
\ x . T, and a free variable of T. We say x is bound in M and free in T.
If T contains a subterm \ x . U then x is rebound in this term. This
nested, inner binding of x is said to "shadow" the outer binding.
Occurrences of x in U are free occurrences of the new x.
Variables bound at the top level of a program are technically free
variables within the terms to which they are bound but are often treated
specially because they can be compiled as fixed addresses. Similarly, an
identifier bound to a recursive function is also technically a free
variable within its own body but is treated specially."

Python does not treat top-level or recursive function names specially in
the way meant above.

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'?
History
Date User Action Args
2009-09-18 22:37:51terry.reedysetrecipients: + terry.reedy, georg.brandl, orsenthil, siona
2009-09-18 22:37:51terry.reedysetmessageid: <1253313471.59.0.560578642744.issue6925@psf.upfronthosting.co.za>
2009-09-18 22:37:50terry.reedylinkissue6925 messages
2009-09-18 22:37:49terry.reedycreate