Meta issue for cleaning up import system cruft
@brettcannon đang làm issue này rồi.
Từ ngày 5/10/2022.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.find_loader()
- importlib.util.module_for_loader()
-
importlib.util.set_loader_wrapper() -
importlib.util.set_package_wrapper() - importlib.abc.Loader.module_repr() (3.12: #97876)
- importlib.abc.MetaPathFinder.find_module()
- importlib.abc.MetaPathFinder.find_module()
- importlib.abc.PathEntryFinder.find_loader()
- importlib.abc.PathEntryFinder.find_module()
-
importlib.machinery.BuiltinImporter.find_module() -
importlib.machinery.BuiltinLoader.module_repr()(3.12: #97876) - importlib.machinery.FileFinder.find_loader()
-
importlib.machinery.FileFinder.find_module() -
importlib.machinery.FrozenImporter.find_module() -
importlib.machinery.FrozenLoader.module_repr()(3.12: #97876) - importlib.machinery.PathFinder.find_module()
-
importlib.machinery.WindowsRegistryFinder.find_module() - Remove
pkgutil.ImpImporter(3.12: already deprecated) - Remove
pkgutil.ImpLoader - Remove the
impmodule (3.12: #98040) -
importlib.abc.Finder
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 usefind_loader())
Other:
- #103999
- PR: gh-98520
- PR: gh-104133
- PR: gh-104134
- PR: gh-108719
- PR: gh-108723
- PR: gh-119656
- PR: gh-128601
- PR: gh-128602
- PR: gh-128654
- PR: gh-128655
- PR: gh-128895
- PR: gh-128896
- PR: gh-129855
- PR: gh-130013
- PR: gh-130017
- PR: gh-131149
- PR: gh-142205
- PR: gh-156418
- PR: gh-156935
- Ngôn ngữ chính
- Python
- Star
- 77.2k
- Fork
- 36k
- Merge trung bình
- 1 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 558
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của python/cpython
-
docs pending
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
stdlib type-feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
stdlib type-feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
build type-bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
stdlib topic-email type-feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Tất cả issue của python/cpython
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
zostera/django-bootstrap4#894 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
use-agent-os/agent-os#3276 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
NousResearch/hermes-agent#117848 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
zilliztech/memsearch#759 ·