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 eric.snow
Recipients anish.shah, brett.cannon, eric.snow, ncoghlan
Date 2016-02-24.01:51:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1456278686.29.0.653236426071.issue26281@psf.upfronthosting.co.za>
In-reply-to
Content
Re: the kw-only arg, it seems weird to accommodate the implementation of one meta-path finder in the signature of importlib.invalidate_caches().

Here's an alternative:

Use a different sys.path_importer_cache sentinel internally (in PathFinder) and never clear None when clearing the cache.

Here's another alternative:

Deprecate sys.path_importer_cache and move/alias it to an internal cache of PathFinder. *  Then add methods to PathFinder to cover the use cases that folks have for interacting with sys.path_importer_cache directly.  In this case it may also make sense to expose the active PathFinder instance as an importlib attribute, for easier access to this key finder.  Doing the same on ImportState will be part of my (eventual) proposal. :)

Of course, neither of those alternatives addresses the case where someone expects sys.path_importer_cache entries to remain fixed once in place.  However, that's a tenuous implicit guarantee already. :)


* The same could be done with sys.path_hooks...
History
Date User Action Args
2016-02-24 01:51:26eric.snowsetrecipients: + eric.snow, brett.cannon, ncoghlan, anish.shah
2016-02-24 01:51:26eric.snowsetmessageid: <1456278686.29.0.653236426071.issue26281@psf.upfronthosting.co.za>
2016-02-24 01:51:26eric.snowlinkissue26281 messages
2016-02-24 01:51:25eric.snowcreate