[issue27515] Dotted name re-import does not rebind after deletion

Guido van Rossum report at bugs.python.org
Fri Jul 15 01:54:18 EDT 2016


Guido van Rossum added the comment:

Are you sure you realize that "import email.charset" doesn't create a
local variable named "email.charset"? It creates a local variable
named "email" which happens to have an attribute "charset".

The problem with "import pack; print(pack.sub)" being unpredictable is
explainable though annoying, but I don't think it can be avoided.
After all there's no intrinsic reason why module "pack" couldn't have
some attribute named "sub" unrelated to a submodule.

I'm not sure what you mean by injections or cleaning them up. Perhaps
there's some overzealousness here that causes this broken behavior?

Is there somewhere in the IDLE code that you'd like me to look at?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27515>
_______________________________________


More information about the Python-bugs-list mailing list