[issue19944] Make importlib.find_spec load packages as needed

Eric Snow report at bugs.python.org
Wed Dec 11 06:59:24 CET 2013


Eric Snow added the comment:

As a testament to counter-intuitive API, I did not even realize this about either find_loader() or find_spec() until the bug the other day with reloading submodules.  So I'm on board!

As to the best approach, I'll argue for keeping just 1 function.  I tried out both ways and in the 2 function approach they simply didn't seem different enough.  I've attached a patch (w/o tests, etc.) to show what I'm thinking.

Basically, let's make the "path" parameter keyword-only and rename it to "parent_path" (maybe even "precomputed_parent_path").  The patch takes cues from pkgutil.find_loader().

----------
keywords: +patch
nosy: +eric.snow
Added file: http://bugs.python.org/file33087/issue19944-find-spec-parent-module.diff

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


More information about the Python-bugs-list mailing list