Strange __future__ behavior in Python 2.5
Avizoa at gmail.com
Avizoa at gmail.com
Sat Sep 23 18:24:15 EDT 2006
mdsteele at gmail.com wrote:
> My understanding of the __future__ statement is that you may say
> something like:
>
> from __future__ import foo, bar
>
> to enable more than one feature. However, this does not seem to be
> working properly in 2.5; it behaves as expected when typed into the
> interactive interpreter, but not when it is in a module. When I try to
> import the following module:
*snip*
> Is this a bug, or am I misunderstanding something? I'm using the final
> release of Python 2.5 (r25:51918, Sep 19 2006, 08:49:13) on Mac OS X.
Only one "from __future__" can be imported per line.
So,
from __future__ import foo
from __future__ import bar
etc.
It will only import the first if you give multiple.
Why this is, I don't know.
More information about the Python-list
mailing list