This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add a load_parents argument to importlib.find_loader()
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.4
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Make importlib.find_spec load packages as needed
View: 19944
Assigned To: Nosy List: asvetlov, brett.cannon, eric.snow
Priority: low Keywords:

Created on 2012-11-17 14:38 by brett.cannon, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg175742 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2012-11-17 14:38
To make using importlib.find_loader() easier, there should be a flag that says to automatically import all parent packages for the desired submodule so as to not force the user to do it::

  def find_loader(name, path=None, *, load_parents=False): ...

That way people who are okay with loading some packages implicitly to get at a specific loader can do so without having to do boilerplate name.split('.'); import each parent code. Also means people don't have to worry about the path argument (unless they explicitly want to trigger loading from a different location).
msg206630 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2013-12-19 19:11
find_loader() is now deprecated and we're going to support auto-importing parent modules in find_spec() (see #19944)
History
Date User Action Args
2022-04-11 14:57:38adminsetgithub: 60696
2013-12-19 19:11:45eric.snowsetstatus: open -> closed

superseder: Make importlib.find_spec load packages as needed

nosy: + eric.snow
messages: + msg206630
resolution: duplicate
stage: test needed -> resolved
2012-12-03 15:34:22asvetlovsetnosy: + asvetlov
2012-11-17 14:38:51brett.cannoncreate