import from future

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Sun Jan 28 02:33:32 EST 2007


In <1169969100.946843.111770 at p10g2000cwp.googlegroups.com>, lee wrote:

> what are the things that we can do with import from future usage.....i 
> heard its very interesting......thanks

Here's how to find out yourself (done with a 2.4 release):

In [2]: import __future__

In [3]: dir(__future__)
Out[3]:
['CO_FUTURE_DIVISION',
 'CO_GENERATOR_ALLOWED',
 'CO_NESTED',
 '_Feature',
 '__all__',
 '__builtins__',
 '__doc__',
 '__file__',
 '__name__',
 'all_feature_names',
 'division',
 'generators',
 'nested_scopes']

In [4]: __future__.all_feature_names
Out[4]: ['nested_scopes', 'generators', 'division']

In [5]: __future__.division
Out[5]: _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)

In [6]: help(__future__)
<snipped help output>

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list