[docs] [issue25509] PyImport_ImportModule inaccurately described

Memeplex report at bugs.python.org
Sat Oct 31 21:58:58 EDT 2015

Memeplex added the comment:

Brett, I'm not sure about that, notice that the "import hook" as is mentioned in the docs is just the current __import__ in the builtins module (which could have been replaced and in this sense would be a "hook") but not proper import hooks. I think the original distinction between PyImport_ImportModule and PyImport_Import is still sensible today. Originally PyImport_ImportModule directly called the import machinery, while PyImport_Import called it indirectly through builtins.__import__ (which could have been replaced). Now, for some reason, for good or for bad, PyImport_ImportModule also goes through builtins.__import__. The documentation is wrong but what is the fix? Revert PyImport_ImportModule or redocument it?


Python tracker <report at bugs.python.org>

More information about the docs mailing list