[Python-Dev] Lexical scoping in Python 3k

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Jul 1 08:15:04 CEST 2006


Josiah Carlson wrote:

> What I asked before, and what I'd like to ask again, is if there are any
> _nontrivial uses_ of lexically nested scopes which are made cumbersome
> by our inability to write to parent scopes.

The trouble with taking that position is that the very
cases which would benefit are very *simple* ones, where
it would be cumbersome to refactor it to use a class,
or mutable object in the outer scope, etc. So you've
effectively set up your acceptance criteria to be
unmeetable.

> If there aren't, then I'm
> going to again have to argue against new syntax, keywords, and their use.

There's one very simple way we could do this in Py3k
without requiring any new syntax or keywords: just
redefine the meaning of "global" to mean "not local".

--
Greg


More information about the Python-Dev mailing list