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.
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!).
(import_machinery.rst) how about a section devoted just to the attributes of modules and packages, perhaps expanding upon or supplanting the related entries in the data model reference page?
runpy, pkgutil, et al in the library manual should all get “See Also” links at the top pointing to the new import system section.
Add more explanation regarding the different ways in which __main__ is initialized?
Add more info on __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 use find_loader())
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
Activity
pythongh-97850: Remove deprecated functions from `importlib.utils`
sobolevn commented on Oct 5, 2022
I've removed importlib.utils.set_loader, importlib.utils.set_package, and
importlib.utils.module_for_loader from importlib.utils in #97898 🎉
gh-97850: Remove all known instances of module_repr() (#97876)
Remove the open issues section from the import reference
pythongh-97850: Remove deprecated functions from `importlib.utils`
Merge branch 'main' into dictwatch
gh-97850: Remove the open issues section from the import reference (#…
pythongh-97850: Remove the open issues section from the import refere…
pythongh-97850: Remove the open issues section from the import refere…
gh-97850: Remove the open issues section from the import reference (G…
[3.11] gh-97850: Remove the open issues section from the import refer…
51 remaining items
[3.13] gh-97850: Update the deprecation warning of `importlib.abc.Loa…
[3.12] gh-97850: Update the deprecation warning of `importlib.abc.Loa…
pythongh-97850: pkgutil: Remove unused imports
pythonGH-97850: Remove all uses and definitions of `load_module()` fr…
GH-97850: Remove all uses and definitions of `load_module()` from imp…
pythongh-150882: Remove unused importlib._bootstrap._object_name
pythongh-150886: Remove unused importlib._bootstrap._object_name
gh-150886: Remove unused importlib._bootstrap._object_name (#150884)
pythongh-150886: Remove unused importlib._bootstrap._object_name (pyt…
gh-97850: Add load_module() removal to 3.15 What's New (GH-156418)
[3.15] gh-97850: Add load_module() removal to 3.15 What's New (GH-156418
pythongh-97850: Add load_module() removal to 3.15 What's New (pythonG…