Brett Cannon [EMAIL PROTECTED] added the comment:
The reason this happens is to support ``import pack.y``. When you
reference the module in this way it is accessing the 'y' attribute on
the 'pack' module. If import didn't set it this form of importing would
never work.
--
resolution: -
Daniel Diniz [EMAIL PROTECTED] added the comment:
Not a bug IMHO, but a gotcha. Change x.py to from pack import y as q
and you get the desired result. Check
http://effbot.org/zone/import-confusion.htm
--
nosy: +ajaksu2
__
Tracker [EMAIL PROTECTED]
Changes by Sean Reifschneider [EMAIL PROTECTED]:
--
assignee: - brett.cannon
nosy: +brett.cannon
priority: - normal
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2210
__
New submission from RĂ¼diger Kupper:
When one module of a package imports another module of the same package,
the second module will not only be introduced in the namespace of the
importing module, but also in the namespace of the enclosing package.
I.e., the module will be introduced as variable