This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients David Hagen, brett.cannon, eric.snow, ncoghlan, r.david.murray, serhiy.storchaka
Date 2017-09-07.21:48:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1504820889.02.0.16716519373.issue31385@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-09-07 21:48:09serhiy.storchakasetrecipients: + serhiy.storchaka, brett.cannon, ncoghlan, r.david.murray, eric.snow, David Hagen
2017-09-07 21:48:09serhiy.storchakasetmessageid: <1504820889.02.0.16716519373.issue31385@psf.upfronthosting.co.za>
2017-09-07 21:48:08serhiy.storchakalinkissue31385 messages
2017-09-07 21:48:08serhiy.storchakacreate