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.

Author ncoghlan
Recipients barry, brett.cannon, eric.araujo, eric.snow, georg.brandl, larry, ncoghlan, skrah
Date 2012-07-31.01:53:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1343699588.44.0.730959248028.issue15295@psf.upfronthosting.co.za>
In-reply-to
Content
As far as the path importer goes, it's important to keep in mind there are *four* different pieces in play:

1. The path importer itself

This is a meta path finder installed on sys.meta_path, which implements the find_module API. It scans the supplied search path (or sys.path) for path entries, using sys.path_importer_cache and sys.path_hooks to find the locate path entry finders. "Path importer" is an eminently appropriate name as it is responsible for *all* of the standard semantics of sys.path and package __path__ attribute processing. It could be potentially be qualified with "standard path importer" or "default path importer" to distinguish it from other cases.

2. The path hooks

These are installed in sys.path_hooks, and are simply callables that accept a path entry and return an appropriate path entry handler or else raise ImportError. The specification is designed to make it easy to use the classes for path entry handlers directly as path hooks (since __init__ can throw ImportError, but it can't return None). For these, "path hook" is just fine as a name.

3. The path entry handlers

These are the objects returned by the path hooks. Historically, they implemented find_module() (without the second "search path" parameter), and now they can implement the "find_loader()" API instead.

The reason I don't like "sys path finder" for these is that it misses their essential role in handling package __path__ attributes. I have previously suggested "path entry finder", but that's a little ambiguous (since it suggests they're tools for *finding* path entries, rather than tools for finding module loaders *given* a path entry). Thus, my new suggestion here: "path entry handler". They're objects that handle particular path entries on behalf of the path importer, so the name is perfectly appropriate, and better distinguishes them from the meta path finder objects.

4. The module loaders

As with any import, the module loaders implement the load_module() API to create, cache, initialise and return a loaded module object.
History
Date User Action Args
2012-07-31 01:53:08ncoghlansetrecipients: + ncoghlan, barry, brett.cannon, georg.brandl, larry, eric.araujo, skrah, eric.snow
2012-07-31 01:53:08ncoghlansetmessageid: <1343699588.44.0.730959248028.issue15295@psf.upfronthosting.co.za>
2012-07-31 01:53:07ncoghlanlinkissue15295 messages
2012-07-31 01:53:07ncoghlancreate