Brett Cannon <br...@python.org> added the comment:

Correct because as documented it calls invalidate_caches() on meta-path finders 
and the one that handles sys.path calls invalidate_caches() on the finders 
found in sys.path_importer_cache() (as documented by 
https://docs.python.org/3/library/importlib.html#importlib.machinery.PathFinder.invalidate_caches).
 Since None isn't a finder it doesn't do anything there as there is no method 
to call. So the "full of lies" comment by the OP on the mypy repo is 
over-the-top/incorrect.

Now tweaking 
https://github.com/python/cpython/blob/521995205a2cb6b504fe0e39af22a81f785350a3/Lib/importlib/_bootstrap_external.py#L1180-L1186
 to delete entries in sys.path_importer_cache() that are set to None is 
straight-forward, but I don't think we can backport since it would be going 
against what the documentation says it does.

----------
versions: +Python 3.8 -Python 3.6

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

Reply via email to