python / python/cpython

Meta issue for cleaning up import system cruft

未关闭
#97,850 21 条评论 0 个 reaction 已指派 2 人 在 GitHub 查看

@brettcannon 已经在做这个了。

开始于 2022年10月5日。

stdlib topic-importlib
主要语言
Python
星标
77.2k
派生
36k
PR 合并指标
PR 指标待抓取

描述

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:

  • #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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。