Update to PEP 227 (static scoping)

Jeremy Hylton jeremy at alum.mit.edu
Fri Feb 23 02:23:15 CET 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

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


More information about the Python-list mailing list