<br><br><div class="gmail_quote">On Thu, May 10, 2012 at 9:56 PM, Nick Coghlan <span dir="ltr"><<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Fri, May 11, 2012 at 11:02 AM, Eric V. Smith <<a href="mailto:eric@trueblade.com">eric@trueblade.com</a>> wrote:<br>
> Feel free to wordsmith it.<br>
<br>
</div>Only minor quibbles:<br>
<br>
"load a regular package" -> "load a module or self-contained package"<br>
(when we get a loader, we don't know if it's for a module or a<br>
package, and I also prefer "self-contained package" over "regular<br>
package", since it's more future proof terminology)<br>
<br>
"will be a list containing only" -> "will contain only"<br>
<br>
Independent of PEP 420, something we should probably consider for the<br>
official documentation of the import system is making a clearer<br>
distinction between importers (on sys.meta_path) and finders (returned<br>
by sys.path_hooks entries) than was the case in PEP 302 (which calls<br>
them all finders).<br>
<br>
Importers:<br>
- installed directly on sys.meta_path<br>
- called via importer.find_module(fullname, path) (where path=None for<br>
a sys.path based import)<br>
<br>
Finders:<br>
- created by the path importer for individual path entries by<br>
traversing sys.path_hooks<br>
- stored in sys.path_importer_cache<br>
- called via finder.find_loader(fullname) (if defined), otherwise via<br>
finder.find_module(fullname)<br>
<br>
Loaders:<br>
- returned from finder.find_loader() (or finder.find_module())<br>
- called via loader.load_module(fullname)<br>
<br>
importlib is *mostly* consistent with the above scheme (with<br>
FrozenImporter, BuiltinImporter, FileFinder and the various *Loader<br>
classes), but PathFinder doesn't fit (it's a meta_path importer, but<br>
uses a "*Finder" name). We could always just change the name to<br>
PathImporter, keeping PathFinder around as a backwards compatibility<br>
alias.</blockquote><div><br></div><div>But PathFinder is not an importer as it is not a finder *and* a loader: <a href="http://docs.python.org/dev/glossary.html#term-importer">http://docs.python.org/dev/glossary.html#term-importer</a> . </div>
</div>