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 Antony.Lee
Recipients Antony.Lee
Date 2012-08-09.00:17:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1344471488.35.0.495705727003.issue15598@psf.upfronthosting.co.za>
In-reply-to
Content
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.)
History
Date User Action Args
2012-08-09 00:18:12Antony.Leesetrecipients: + Antony.Lee
2012-08-09 00:18:08Antony.Leesetmessageid: <1344471488.35.0.495705727003.issue15598@psf.upfronthosting.co.za>
2012-08-09 00:18:07Antony.Leelinkissue15598 messages
2012-08-09 00:17:59Antony.Leecreate