Relative-importing *

rbygscrsepda at gmail.com rbygscrsepda at gmail.com
Fri Jul 27 14:11:14 EDT 2007


Hi, I'm a newbie at Python. :) Right now it's not letting me import *
from any relative package name--i.e., a name that starts with a dot.
For instance, none of the following work:

    from . import *
    from .sibiling import *
    from .. import *
    from ..parent_sibling import *

...and so on. The same error occurs:
    SyntaxError: 'import *' not allowed with 'from .'

(I have Python 2.5.1.)

Why would it not let me import * from a relative module at all? I read
that they're planning to make absolute imports the default, so I'd
think that this sort of thing would become more common in the future.

Thanks in advance! :)




More information about the Python-list mailing list