[Python-Dev] SyntaxError: 'import *' not allowed with 'from .'

George Sakkis george.sakkis at gmail.com
Wed Jan 16 19:50:47 CET 2008


I posted this on c.l.py but I didn't get a definite answer so I am
asking again here: is it documented anywhere that "from
.relative.module import *' is syntax error? Unless I missed it, PEP
328 doesn't mention anything about it. Also, while I understand the
general caveats and warnings against "import *", at first glance it
seems inconsistent to disallow it for relative imports while it is
valid for absolute. Are there any particular reasons that allowing
relative '*' imports is harder to implement, more fragile or generally
worse in some way ?

George


More information about the Python-Dev mailing list