Visitar URL original
Meta issue for cleaning up import system cruft · Issue #97850 · python/cpython · GitHub
Skip to content

Meta issue for cleaning up import system cruft #97850

Description

@warsaw

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.

Update docs

  • Make sure examples and details from PEP 302 are covered in the importlib docs (/cc @Yhg1s )
  • Remove https://docs.python.org/3/reference/import.html#open-issues (PR)
  • It would be really nice to have a diagram.
  • (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())

Other:

Activity

  1. 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
  2. self-assigned this
    on Oct 5, 2022
  3. added a commit that references this issue on Oct 5, 2022
  4. sobolevn commented on Oct 5, 2022

    @sobolevn
    Member

    I've removed importlib.utils.set_loader, importlib.utils.set_package, and
    importlib.utils.module_for_loader from importlib.utils in #97898 🎉

  5. added a commit that references this issue on Oct 5, 2022
  6. self-assigned this
    on Oct 5, 2022
  7. added a commit that references this issue on Oct 5, 2022
  8. added a commit that references this issue on Oct 6, 2022
  9. added a commit that references this issue on Oct 6, 2022
  10. added 4 commits that reference this issue on Oct 6, 2022
  11. 51 remaining items

  12. added 2 commits that reference this issue on Feb 11, 2025
  13. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Feb 24, 2025
  14. added a commit that references this issue on Mar 12, 2025
  15. added a commit that references this issue on Dec 2, 2025
  16. added a commit that references this issue on Dec 10, 2025
  17. added 2 commits that reference this issue on Jun 3, 2026
  18. added a commit that references this issue on Jun 4, 2026
  19. added a commit that references this issue on Jun 17, 2026
  20. added a commit that references this issue on Sep 4, 2026
  21. added a commit that references this issue on Sep 5, 2026
  22. added a commit that references this issue on Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

stdlibStandard Library Python modules in the Lib/ directorytopic-importlib

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions