Message301634
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. |
|
Date |
User |
Action |
Args |
2017-09-07 21:48:09 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, brett.cannon, ncoghlan, r.david.murray, eric.snow, David Hagen |
2017-09-07 21:48:09 | serhiy.storchaka | set | messageid: <1504820889.02.0.16716519373.issue31385@psf.upfronthosting.co.za> |
2017-09-07 21:48:08 | serhiy.storchaka | link | issue31385 messages |
2017-09-07 21:48:08 | serhiy.storchaka | create | |
|