Eric Snow added the comment:

Is the problem here that builtins (and extension modules) don't necessarily 
obey the rules to the letter?  load_module() is supposed to use whatever is in 
sys.modules. [1]  (BuiltinImporter.load_module() is essentially a synonym for 
_imp.init_builtin(), right?)

So in each PyInit_*() the code should be using the module out of sys.modules... 
 That sounds like a bug and I expect that the builtin modules and most 
extension modules don't comply.

That said, I realize the spirit of the load_module() rule is to support 
reloading, which is mostly not applicable to builtins and extension modules.  
The code you reverted would rely on enforcing the rule outside the implicit 
applicability.

I'll be glad when we've resolved the extension module API changes that support 
exec_module()!

[1] 
http://docs.python.org/dev/library/importlib.html#importlib.abc.Loader.load_module

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19698>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to