[Python-Dev] closure semantics
Guido van Rossum
guido at python.org
Thu Oct 23 23:44:51 EDT 2003
More information about the Python-Dev mailing list
Thu Oct 23 23:44:51 EDT 2003
- Previous message: [Python-Dev] closure semantics
- Next message: [Python-Dev] random.choice IndexError on empty list
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> We've been assuming all along that the semantics of a > plain "global" statement have to remain exactly as they > are, but is that strictly necessary? > > How much hardship would it cause, really, if "global" > were simply redefined to mean "the next scope out where > it's bound"? > > It would only break something if "global" were used in > a nested function *and* there were a variable with the > same name in some intermediate scope. That sounds like > a rather rare set of conditions to me. Not significantly > more common than "yield" being used as a variable name, > surely? Reasonable assumption. We'd have to do a survey. --Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-Dev] closure semantics
- Next message: [Python-Dev] random.choice IndexError on empty list
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list