New submission from Antony Lee: The language reference is clear: "The from form does not bind the module name" (Section 6.12)
However, consider the following example: * package/__init__.py: foo = "FOO" from .foo import bar print(foo) os = "OS" from os import path print(os) * package/foo.py: foo = 42 Now "import package" results in printing: <module 'pypackage.foo' from 'pypackage/foo.py'> OS i.e., the relative "from ... import" has not only bound "bar", but also "foo", which seems to contradict the documentation. (I get the same behaviour using 3.2.3 as well as 2.7.3.) ---------- messages: 167742 nosy: Antony.Lee priority: normal severity: normal status: open title: relative import unexpectedly binds name versions: Python 3.2 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15598> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com