'from __future__ import ...' overview

L

Logan

Is there a list with all 'from __future__ import ...' statements
(which lists all the statements, in which version of Python the
feature was introduced and in which version of Python it will become
the default behavior)?

I guess, normally such a list is not necessary because a new feature
needs its 'from __future__ import ...' statement only in the present
version of Python and will become default in the next version. But
e.g. 'from __future__ import division' is said to not become default
before Python 3.0.

Usually, I use A.M. Kuchling's "What's new in Python 2.x" articles
for that kind of stuff; but I thought, such a might exist somewhere
as a short reference.

Any links?
 
S

Serge Orlov

Logan said:
Is there a list with all 'from __future__ import ...' statements
(which lists all the statements, in which version of Python the
feature was introduced and in which version of Python it will become
the default behavior)?
import __future__
print __future__.all_feature_names
print __future__.division

-- Serge
 
A

Andrew Bennetts

Is there a list with all 'from __future__ import ...' statements
(which lists all the statements, in which version of Python the
feature was introduced and in which version of Python it will become
the default behavior)?

Yes -- __future__.py in the python standard library.

-Andrew.
 
M

Michael Hudson

Logan said:
Is there a list with all 'from __future__ import ...' statements
(which lists all the statements, in which version of Python the
feature was introduced and in which version of Python it will become
the default behavior)?

Yes: in __future__.py :)

Cheers,
mwh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top