New submission from Barry A. Warsaw <ba...@python.org>:

I think this is mostly just out of date documentation, but I want to get 
Brett's feedback.  The sys module has this to say about sys.path_importer_cache:

"A dictionary acting as a cache for finder objects. The keys are paths that 
have been passed to sys.path_hooks and the values are the finders that are 
found. If a path is a valid file system path but no explicit finder is found on 
sys.path_hooks then None is stored to represent the implicit default finder 
should be used. If the path is not an existing path then imp.NullImporter is 
set."

Notice that last sentence.  AFAICT, this is not true in importlib.  I can find 
no relevant reference to imp.NullImporter in _bootstrap.py.  Maybe we should 
just remove this from the documentation?  OTOH, there are a few tests that 
check semantics related to imp.NullImporter found in sys.path_importer_cache, 
so clearly there are API constraints.  See also runpy.py, which gives some 
semantics to finding this importer in the cache.

Any suggestions for better wording about imp.NullImporter and 
sys.path_importer_cache?  I'd like to add this to my rewritten import machinery 
docs, but I'm not exactly sure what to say about it.

----------
assignee: brett.cannon
components: Documentation
messages: 166595
nosy: barry, brett.cannon, eric.smith, ncoghlan
priority: normal
severity: normal
status: open
title: importlib no longer uses imp.NullImporter
versions: Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15473>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to