O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Enabling Future Features

New language features that affect compatibility with older versions of Python are often disabled when they first appear in a release. To enable these features, the statement from __future__ import feature can be used. For example:

# Enable new division semantics
from __future__ import division

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).

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required