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 brett.cannon, eric.snow, ncoghlan, pje
Date 2013-12-10.05:54:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1386654881.95.0.820542970377.issue19939@psf.upfronthosting.co.za>
In-reply-to
Content
In the last Python releases, particularly 3.3 and 3.4, we've made improvements to the import machinery that render (at least) portions of pkgutil obsolete.  Here's a breakdown of the public API of pkgutil:

get_importer() - duplicate of PathFinder._path_importer_cache()
iter_importers() - yields the path entry finder for each path entry
find_loader() - a parent-importing wrapper around (deprecated) importlib.find_loader()
get_loader() - looks at module.__loader__ or calls find_loader()
walk_packages() - loader-focused
iter_modules() - loader-focused
get_data() - a wrapper around the InspectLoader.get_data() API
read_code() - duplicates importlib functionality
extend_path() - no longer needed (namespace packages)
ImpImporter - already deprecated in favor of importlib
ImpLoader - already deprecated in favor of importlib

I would expect that nearly all of the module could be deprecated and any gaps in functionality ported to importlib.util.

Is it worth it to go to the effort?  To me the biggest thing would be identifying what functionality (e.g. locating all packages within a directory) in pkgutil is still relevant and should be distilled into public APIs in importlib.  The job of actually deprecating and porting code would mostly be mechanical and not even a large amount of work.
History
Date User Action Args
2013-12-10 05:54:42eric.snowsetrecipients: + eric.snow, brett.cannon, pje, ncoghlan
2013-12-10 05:54:41eric.snowsetmessageid: <1386654881.95.0.820542970377.issue19939@psf.upfronthosting.co.za>
2013-12-10 05:54:41eric.snowlinkissue19939 messages
2013-12-10 05:54:40eric.snowcreate