[issue31385] `import as` does not work when module has same same as parent module

2017-09-07 Thread Nick Coghlan
Nick Coghlan added the comment: As Serhiy notes, this isn't a bug in the import name resolution, it's a consequence of the wildcard import in bugtest's __init__.py replacing its own "bug.foo" submodule attribute with a reference to "bug.foo.foo". If the star imports can't be avoided, then a po

[issue31385] `import as` does not work when module has same same as parent module

2017-09-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In 3.7 the error is different: >>> import bugtest.foo.foo as bar Traceback (most recent call last): File "", line 1, in ImportError: cannot import name 'foo' from 'bugtest.foo.foo' (/home/serhiy/py/cpython/bugtest/foo/foo.py) The statement "from .foo impo

[issue31385] `import as` does not work when module has same same as parent module

2017-09-07 Thread R. David Murray
R. David Murray added the comment: It seems likely that this is related to the problems discussed (and hopefully solved) in issue 30024. -- nosy: +r.david.murray ___ Python tracker ___

[issue31385] `import as` does not work when module has same same as parent module

2017-09-07 Thread David Hagen
New submission from David Hagen: Consider the following Python project: bugtest/ __init__.py (Contents: from .foo import *) foo/ __init__.py (Contents: from .foo import *) foo.py (Contents: ) Then in a Python session, the following line executes without error (as expected): >>> im