Repository navigation
Meta issue for cleaning up import system cruft #97850
Copy link
Copy link
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-importlib
Description
Activity
- changed the title
[-]Task list for cleaning up import system cruft for Python 3.12[/-][+]Meta issue for cleaning up import system cruft[/+]on Oct 4, 2022 - added a commit that references this issue
on Oct 5, 2022 I've removed
importlib.utils.set_loader,importlib.utils.set_package, and
importlib.utils.module_for_loaderfromimportlib.utilsin #97898 🎉- added a commit that references this issue
on Oct 5, 2022 - added a commit that references this issue
on Oct 5, 2022 - added a commit that references this issue
on Oct 5, 2022 - added a commit that references this issue
on Oct 6, 2022 - added a commit that references this issue
on Oct 6, 2022 - added 4 commits that reference this issue
on Oct 6, 2022 51 remaining items
- addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
on Feb 24, 2025 - added a commit that references this issue
on Mar 12, 2025 - marked Remove deprecated
importlib.load_module#133882 as a duplicate of this issueon May 11, 2025 - unmarked Remove deprecated
importlib.load_module#133882 as a duplicate of this issueon May 11, 2025 - added a commit that references this issue
on Dec 10, 2025
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-importlib
This is a meta issue tracking all the things that need to be cleaned up in the import system. From removing long deprecated APIs to migrating internal access to
__spec__, we'll have several task lists for each related set of clean ups.@brettcannon @ericsnowcurrently for visibility.
Removing deprecated APIs
Over in What's New for Python 3.11 there's a long list of things that have been deprecated long enough that they can be removed in Python 3.12. Here's that task list for tracking purposes. Watch for linked PRs (maybe one big one or many small ones -- we'll see!).
@brettcannon @ericsnowcurrently for visibility.
importlib.util.set_loader_wrapper()importlib.util.set_package_wrapper()importlib.machinery.BuiltinImporter.find_module()importlib.machinery.BuiltinLoader.module_repr()(3.12: gh-97850: Remove all known instances of module_repr() #97876)importlib.machinery.FileFinder.find_module()importlib.machinery.FrozenImporter.find_module()importlib.machinery.FrozenLoader.module_repr()(3.12: gh-97850: Remove all known instances of module_repr() #97876)importlib.machinery.WindowsRegistryFinder.find_module()pkgutil.ImpImporter(3.12: already deprecated)pkgutil.ImpLoaderimpmodule (3.12: Remove more deprecated importlib APIs from Python 3.12 #98040)importlib.abc.FinderUpdate docs
__main__is initialized?__main__quirks/pitfalls (i.e. copy from PEP 395).Missing deprecations
Here's a list of related APIs that have not yet been deprecated, but should be. We'll deprecate them in 3.12 and remove them in 3.14.
pkgutil.find_loader()pkgutil.get_loader()(or it needs to be reimplemented to not usefind_loader())Other:
find_loaderandget_loaderinpkgutil#98520module_reprmethod #104133importlib.utilfunctions #104134importlib.util.set_loaderandimportlib.util.module_for_loaderhave been removed #108719importlib.util.set_loaderandimportlib.util.module_for_loaderhave been removed (GH-108719) #108723find_loaderandget_loaderfrompkgutil#119656TraversableResourcesas the alternative forResourceLoader. #128601ResourceReaderdocs #128602ResourceReaderdocs (GH-128602) #128654ResourceReaderdocs (GH-128602) #128655TraversableResourcesas the alternative forResourceLoader(GH-128601) #128895TraversableResourcesas the alternative forResourceLoader(GH-128601) #128896importlib.abc.Loader.load_module#129855importlib.abc.Loader.load_module(GH-129855) #130013importlib.abc.Loader.load_module(GH-129855) #130017load_module()from importlib #142205