Serhiy Storchaka added the comment:

In 3.7 the error is different:

>>> import bugtest.foo.foo as bar
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'foo' from 'bugtest.foo.foo' 
(/home/serhiy/py/cpython/bugtest/foo/foo.py)

The statement "from .foo import *" in bugtest/__init__.py imports name foo from 
the module bugtest.foo and rewrites the attribute foo.

>>> import bugtest
>>> bugtest.foo
<module 'bugtest.foo.foo' from '/home/serhiy/py/cpython/bugtest/foo/foo.py'>

This behavior is the same in all supported Python versions.

----------
nosy: +brett.cannon, eric.snow, ncoghlan, serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31385>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to