You can't, and that's by design. This is because more __future__
features might be added in the future, and those can break your code.
Imagine that in 2.x, the only __future__
feature was division
. Then in 2.y, a new __future__
feature, print_function
, is introduced. All of a sudden my code has broken:
from __future__ import *
print "Hello, World!"
You can, however, import __future__
, and inspect its contents:
>>> import __future__
>>> [x for x in dir(__future__) if x.islower() and x[0] != '_']
['absolute_import', 'all_feature_names', 'division', 'generator_stop', 'generators', 'nested_scopes', 'print_function', 'unicode_literals', 'with_statement']
Note that these are not features and you should not try to import them. They instead describe which features are available, and from which versions they are.
annotations
is missing. – Raid