PEP 1 – PEP Purpose and Guidelines (What is a PEP?; PEP Audience; PEP Types) PEP 1:什么是 PEP? 巴里·华沙、杰里米·希尔顿、戴维·古杰、艾丽莎·科格伦 Barry Warsaw, Jeremy Hylton, David Goodger, Alyssa Coghlan(PEP 创建于 2000 年) 2000 年 6 月 13 日,此后屡有修订 冷冻图书馆 · 开架书库 · S-007202 · https://coldlibrary.com/s/007202 权利:作者声明:“本文档置于公有领域,或采用 CC0-1.0-Universal 许可,以二者中更宽松者为准。”已按澳大利亚、欧盟、英国、中国大陆和美国的规则核对(截至 2026 年 10 月 11 日)。仅供参考,不是法律意见。 来源:Python Enhancement Proposals, PEP 1,https://peps.python.org/pep-0001/(取于 2026-10-11) 中文译文:Claude(AI),2026 · CC0 1.0 生成于 2026-10-14,来自 https://coldlibrary.com/open-stacks/pep-1-what-is-a-pep ---- What is a PEP? PEP stands for Python Enhancement Proposal. A PEP is a design document providing information to the Python community, or describing a new feature for Python or its processes or environment. The PEP should provide a concise technical specification of the feature and a rationale for the feature. We intend PEPs to be the primary mechanisms for proposing major new features, for collecting community input on an issue, and for documenting the design decisions that have gone into Python. The PEP author is responsible for building consensus within the community and documenting dissenting opinions. Because the PEPs are maintained as text files in a versioned repository, their revision history is the historical record of the feature proposal. This historical record is available by the normal git commands for retrieving older revisions, and can also be browsed on GitHub. PEP Audience The typical primary audience for PEPs are the core developers of the CPython reference interpreter and their elected Steering Council, as well as developers of other implementations of the Python language specification. However, other parts of the Python community may also choose to use the process (particularly for Informational PEPs) to document expected API conventions and to manage complex design coordination problems that require collaboration across multiple projects. PEP Types There are three kinds of PEP: 1. A **Standards Track** PEP describes a new feature or implementation for Python. It may also describe an interoperability standard that will be supported outside the standard library for current Python versions before a subsequent PEP adds standard library support in a future version. 2. An **Informational** PEP describes a Python design issue, or provides general guidelines or information to the Python community, but does not propose a new feature. Informational PEPs do not necessarily represent a Python community consensus or recommendation, so users and implementers are free to ignore Informational PEPs or follow their advice. 3. A **Process** PEP describes a process surrounding Python, or proposes a change to (or an event in) a process. Process PEPs are like Standards Track PEPs but apply to areas other than the Python language itself. They may propose an implementation, but not to Python's codebase; they often require community consensus; unlike Informational PEPs, they are more than recommendations, and users are typically not free to ignore them. Examples include procedures, guidelines, changes to the decision-making process, and changes to the tools or environment used in Python development. Any meta-PEP is also considered a Process PEP. ---- 中文译文 · Claude(AI)译 什么是 PEP? PEP 是“Python 增强提案”(Python Enhancement Proposal)的缩写。PEP 是一份设计文档,或者向 Python 社区提供信息,或者描述 Python 的一项新特性、Python 的流程或环境。PEP 应当为这项特性提供一份简明的技术规范,以及采用它的理由。 我们希望 PEP 成为提出重大新特性、就某个问题收集社区意见,以及记录 Python 所采纳的设计决定的主要机制。PEP 的作者负责在社区内建立共识,并记录不同的意见。 由于 PEP 以文本文件的形式保存在一个有版本管理的代码库里,它们的修订历史就是这项特性提案的历史记录。这份历史记录可以用普通的 git 命令取回旧的修订版本来查看,也可以在 GitHub 上浏览。 PEP 的读者 PEP 典型的主要读者,是 CPython 参考解释器的核心开发者和他们选出的指导委员会,以及 Python 语言规范其他实现的开发者。 不过,Python 社区的其他部分也可以选择使用这一流程(特别是信息类 PEP),来记录人们期望的 API 惯例,并处理需要多个项目协作的复杂设计协调问题。 PEP 的类型 PEP 有三种: 1. **标准轨道** PEP 描述 Python 的一项新特性或新实现。它也可以描述一项互操作标准:在后续的 PEP 于未来某个版本中把它加入标准库之前,这项标准先在标准库之外为当前的 Python 版本提供支持。 2. **信息类** PEP 描述 Python 的某个设计问题,或者向 Python 社区提供一般的指导或信息,但不提出新特性。信息类 PEP 不一定代表 Python 社区的共识或建议,所以用户和实现者可以忽略它,也可以采纳它的意见。 3. **流程类** PEP 描述围绕 Python 的某个流程,或者提议对某个流程(或流程中的某个事件)作出改变。流程类 PEP 和标准轨道 PEP 相似,但适用于 Python 语言本身以外的领域。它们可以提出一项实现,但不是针对 Python 的代码库;它们往往需要社区的共识;与信息类 PEP 不同,它们不只是建议,用户通常不能随意忽略。例子包括各种程序、准则、决策流程的变更,以及 Python 开发所用工具或环境的变更。任何元 PEP 也都被视为流程类 PEP。