SyntaxError: 'import *' not allowed with 'from .'

Carl Banks pavlovevidence at
Tue Jan 15 00:46:07 CET 2008

On Jan 14, 2:37 pm, George Sakkis <george.sak... at> wrote:
> Unless I missed it, PEP 328 doesn't mention anything about this.
> What's the reason for not allowing "from .relative.module import *' ?

I'm just guessing: it could accidentally create infinite recursion.
Or, perhaps something more subtle than infinite recursion, such as
hard-to-comprehend rules about what modules and subpackages would be
imported.  So they just decided to disallow it.  Just a guess.

Carl Banks

More information about the Python-list mailing list