You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.)
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: