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 brett.cannon, eric.snow, georg.brandl, larry, ncoghlan, rbcollins
Date 2015-03-30.01:23:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1427678636.09.0.796087584671.issue23809@psf.upfronthosting.co.za>
In-reply-to
Content
I had an idea for a possible importlib.util API to support this capability: an "ignore_entries=0" default arg to https://docs.python.org/dev/library/importlib.html#importlib.util.find_spec

The new arg would say how many found entries to skip when looking for the module, defaulting to returning the first hit as it does now.

The challenging part would be that all the implicit import system caching is currently built around the notion of "there can be only one", so we'd likely want to introduce something like a new name shadowing cache that mapped "(modname, ignored_entries)" pairs to module specs (and was cleared by importlib.invalidate_caches() along with everything else).
History
Date User Action Args
2015-03-30 01:23:56ncoghlansetrecipients: + ncoghlan, brett.cannon, georg.brandl, larry, rbcollins, eric.snow
2015-03-30 01:23:56ncoghlansetmessageid: <1427678636.09.0.796087584671.issue23809@psf.upfronthosting.co.za>
2015-03-30 01:23:56ncoghlanlinkissue23809 messages
2015-03-30 01:23:55ncoghlancreate