Testing for version to use from __future__ in 2.1

Neil Schemenauer nas at python.ca
Sat May 12 14:30:25 EDT 2001


Daniel Klein wrote:
> if sys.version[:3] == '2.1': from __future__ import nested_scopes

The __future__ mechanism is a compile time directive.  Think
about this.  Read the PEP.

As f-bot says, if you want your code to run on 2.0 don't use
nested scopes.

  Neil




More information about the Python-list mailing list