Linux/Unix > Python Essential Reference, Second Edition > 10. Execution Environment > Enabling Future Features | See All Titles

< BACK | Make Note | Bookmark | CONTINUE >

155117184014003188065099048180054212144238241179195140058238111161105082191051205119161086

### Enabling Future Features

Starting in Python 2.1, new language features that affect compatibility with older versions of Python may be disabled when they first appear in a release. To enable these features, the statement `from _ _ future_ _ import` `feature` can be used. For example:

    # Enable nested scopes in Python 2.1
    from __ future __ import nested_scopes

When used, this statement should appear as the first statement of a module or program. Furthermore, the intent of the `_ _ future_ _` module is to introduce features that will eventually be a standard part of the Python language (in which case, the use of `_ _ future_ _` will not be required).

| Last updated on 3/28/2002 Python Essential Reference, Second Edition, © 2002 New Riders Publishing

< BACK | Make Note | Bookmark | CONTINUE >

© 2002, O'Reilly & Associates, Inc.