Update to PEP 227 (static scoping)

Jeremy Hylton jeremy at alum.mit.edu
Thu Feb 22 20:23:15 EST 2001


>>>>> "DT" == Don Tuttle <tuttledon at hotmail.com> writes:

  DT> could lexical scoping be implemented as a command line switch?  '-L'

It would have to be -N, because Python is already lexically scoped.
The question of the moment is whether the scopes should nest.

But, no, it can't be done via the command-line, because code written
with nested scopes will not necessarily work with the old scoping
rules and vice versa.  If I hand you a module, it is possible it will
work with one and only one set of scoping rules.  If you run it with
the wrong command line argument, it will blow up.  Worse, that module
can't be combined with another module that depends on the opposite
rules.  

An alternative would be to add a notation to the module telling the
compiler which rules it expects.

Jeremy







More information about the Python-list mailing list