[issue15720] move __import__() out of the default lookup chain

Eric Snow report at bugs.python.org
Sat Aug 18 08:17:56 CEST 2012


Eric Snow added the comment:

Ah, __import__() is used all over the place in the stdlib.  I won't have time right away to put together the patch then.  However, here's what I'm planning:

* expose builtin___import__() (from Python/bltinmodule.c) as imp.__import__().
* expose one used by the interpreter as builtins.__import__(), thus keeping it replaceable.
* hide it in <module globals>.__builtins__.

That last part is the tricky part, and has a bit of a smell to it...  Simply removing it from builtins would be easiest, but that still seems like the right place to go when you want to replace it with your own flashy __import__().

Insight appreciated, but this is definitely low priority at least for the next few months.

----------
priority: normal -> low

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


More information about the Python-bugs-list mailing list