from future module!!!!!!!

S

Stargaming

lee said:
Guys whats the from future module in python?thanks

http://docs.python.org/lib/module-future.html

It's a module with that "future changes" may be activated (currently
such as the with_statement, what isn't in the "2.5 standard" so far).

BTW, it's not the 'from future' module, it's just the 'future' (or
'__future__') module. The 'from' clause is a keyword in python used for
imports in the module namespace.

Stargaming
 
M

Michael

Stargaming said:
The 'from' clause is a keyword in python used for
imports in the module namespace.

Typically, but in the case of "from __future__ ..." it actually changes the
logic of the interpreter/compiler. As a result if you intend to use any
features from __future__ you have to ensure that that directive comes first.
It looks like any other module on the surface, but it's a little special.

(This also means that if you intend to use any modules that use these
features you need to import it in your top level code as well)


Michael.
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top