Division
Oren Tirosh
oren-py-l at hishome.net
Sat May 17 12:01:04 EDT 2003
On Sat, May 17, 2003 at 05:44:44PM +0200, Gerrit Holl wrote:
> BTW, confusing error:
>
> 9 >>> from __future__ import *
> File "<stdin>", line 1
> SyntaxError: future statement does not support import *
> ~~~~~~~~~~~
>
> Wouldn't ImportError be more correct?
>
Nope, it's really a syntax error. The "from __future__ import..." is
special-cased by the compiler. That's how it knows, for example, that
it should treat the word "yield" as a keyword instead of a regular
symbol.
This error will be generated even if you just compile a piece of code.
To get an ImportError you need to actually execute it.
Oren
More information about the Python-list
mailing list