[New-bugs-announce] [issue24029] Surprising name binding behavior of submodule imports needs documenting
Barry A. Warsaw
report at bugs.python.org
Wed Apr 22 19:14:50 CEST 2015
New submission from Barry A. Warsaw:
As described here: http://news.gmane.org/find-root.php?message_id=20150422115959.1ff2ee58%40limelight.wooz.org
Importing a submodule binds the submodule's name in the parent module's namespace. This is surprising, but it seems intentional and it's relied upon by existing code, e.g. asyncio/__init__.py in the stdlib.
It's also not documented afaict. It should be documented in the Language Reference's section on the import system. After a little more discussion on import-sig, I plan on doing that.
----------
assignee: barry
components: Documentation
messages: 241816
nosy: barry, brett.cannon
priority: normal
severity: normal
status: open
title: Surprising name binding behavior of submodule imports needs documenting
type: behavior
versions: Python 3.4, Python 3.5
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24029>
_______________________________________
More information about the New-bugs-announce
mailing list