PEP 484 introduced type hinting to Python, with goals of making typing gradual and easy to adopt. Currently, typing information must be distributed manually. This PEP provides a standardized means to leverage existing tooling to package and distribute t...| Python Enhancement Proposals (PEPs)
Though easy and elegant to use, Python f-strings can be vulnerable to injection attacks when used to construct shell commands, SQL queries, HTML snippets and similar (for example, os.system(f"echo {message_from_user}")). This PEP introduces template lit...| Python Enhancement Proposals (PEPs)
This PEP proposes a new file format for specifying dependencies to enable reproducible installation in a Python environment. The format is designed to be human-readable and machine-generated. Installers consuming the file should be able to calculate wha...| Python Enhancement Proposals (PEPs)
We propose a new notation, {/}, to construct and represent the empty set. This is modelled after the corresponding mathematical symbol ‘\emptyset’.| Python Enhancement Proposals (PEPs)
This document proposes to lift some of the restrictions originally formulated in PEP 498 and to provide a formalized grammar for f-strings that can be integrated into the parser directly. The proposed syntactic formalization of f-strings will have some ...| Python Enhancement Proposals (PEPs)
This PEP defines semantics for executing any Python module as a script, either with the -m command line switch, or by invoking it via runpy.run_module(modulename).| Python Enhancement Proposals (PEPs)
PEP 3147 described an extension to Python’s import machinery that improved the sharing of Python source code, by allowing more than one byte compilation file (.pyc) to be co-located with each source file.| Python Enhancement Proposals (PEPs)
This PEP proposes a scheme for new ‘manylinux’ wheel tags to be defined without requiring a PEP for every specific tag, similar to how Windows and macOS tags already work. This will allow package maintainers to take advantage of new tags more quickly, w...| Python Enhancement Proposals (PEPs)
To analyze Python programs precisely, type checkers need to know when two classes can and cannot have a common child class. However, the information necessary to determine this is not currently part of the type system. This PEP adds a new decorator, @typing.solid_base, that indicates that a class is a “solid base”. Two classes that have distinct, unrelated solid bases cannot have a common child class.| Newest Python PEPs
This PEP proposes the creation of a new standard library module named profilers to organize Python’s built-in profiling tools under a single, coherent namespace.| Python Enhancement Proposals (PEPs)
This PEP proposes to deal with the current limitations of object finalization. The goal is to be able to define and run finalizers for any object, regardless of their position in the object graph.| Python Enhancement Proposals (PEPs)
This PEP proposes extending list, set, and dictionary comprehensions, as well as generator expressions, to allow unpacking notation (* and **) at the start of the expression, providing a concise way of combining an arbitrary number of iterables into one...| Python Enhancement Proposals (PEPs)
Extension module initialization currently has a few deficiencies. There is no cleanup for modules, the entry point name might give naming conflicts, the entry functions don’t follow the usual calling convention, and multiple interpreters are not support...| Python Enhancement Proposals (PEPs)
This PEP proposes to add a way for CPython extension methods to access context, such as the state of the modules they are defined in.| Python Enhancement Proposals (PEPs)
This PEP proposes a redesign of the way in which built-in and extension modules interact with the import machinery. This was last revised for Python 3.0 in PEP 3121, but did not solve all problems at the time. The goal is to solve import-related problem...| Python Enhancement Proposals (PEPs)
Type aliases are user-specified types which may be as complex as any type hint, and are specified with a simple variable assignment on a module top level.| Python Enhancement Proposals (PEPs)
This PEP proposes a Python-level API for the buffer protocol, which is currently accessible only to C code. This allows type checkers to evaluate whether objects implement the protocol.| Python Enhancement Proposals (PEPs)
This PEP proposes a standardized set of index-supplied project status markers, as well as a mechanism for communicating those markers in the HTML and JSON simple indices.| Python Enhancement Proposals (PEPs)
This PEP proposes extending the core metadata specification for Python packaging to include a new, repeatable field named Import-Name to record the import names that a project owns once installed. A new key named import-names will be added to the [proje...| Python Enhancement Proposals (PEPs)
This PEP introduces the concept of generators to Python, as well as a new statement used in conjunction with them, the yield statement.| Python Enhancement Proposals (PEPs)
This PEP proposes adding an @override decorator to the Python type system. This will allow type checkers to prevent a class of bugs that occur when a base class changes methods that are inherited by derived classes.| Python Enhancement Proposals (PEPs)
In this PEP, we propose a new entry point for C extension modules, by which one can define a module using an array of PyModuleDef_Slot structures without an enclosing PyModuleDef structure. This allows extension authors to avoid using a statically alloc...| Python Enhancement Proposals (PEPs)
This PEP proposes a C and Python level API, as well as command line flags, to issue warning messages and control what happens to them. This is mostly based on GvR’s proposal posted to python-dev on 05-Nov-2000, with some ideas (such as using classes to...| Python Enhancement Proposals (PEPs)
This PEP proposes a new module for number-theoretical, combinatorial and other functions defined for integer arguments, like math.gcd() or math.isqrt().| Python Enhancement Proposals (PEPs)
This PEP defines a specification how licenses are documented in the Python projects.| Python Enhancement Proposals (PEPs)
This PEP introduces template strings for custom string processing.| Python Enhancement Proposals (PEPs)
This PEP introduces the concept of type defaults for type parameters, including TypeVar, ParamSpec, and TypeVarTuple, which act as defaults for type parameters for which no type is specified.| Python Enhancement Proposals (PEPs)
This document describes the development and release schedule for Python 3.15.| Python Enhancement Proposals (PEPs)
PyGILState_Ensure(), PyGILState_Release(), and other related functions in the PyGILState family are the most common way to create native threads that interact with Python. They have been the standard for over twenty years (PEP 311). But, over time, thes...| Python Enhancement Proposals (PEPs)
PEP 750 introduced template strings (t-strings) as a generalization of f-strings, providing a way to safely handle string interpolation in various contexts. This PEP proposes extending the subprocess and shlex modules to natively support t-strings, enab...| Python Enhancement Proposals (PEPs)
CPython has supported multiple interpreters in the same process (AKA “subinterpreters”) since version 1.5 (1997). The feature has been available via the C-API. [c-api] Multiple interpreters operate in relative isolation from one another, which facilit...| Python Enhancement Proposals (PEPs)
This document specifies a proposed standard interface between web servers and Python web applications or frameworks, to promote web application portability across a variety of web servers.| Python Enhancement Proposals (PEPs)
This PEP proposes a new platform tag series pyodide for binary Python package distributions for the Pyodide Python runtime.| Python Enhancement Proposals (PEPs)
Emscripten is a complete open source compiler toolchain. It compiles C/C++ code into WebAssembly/JavaScript executables, for use in JavaScript runtimes, including browsers and Node.js. The Rust language also maintains an Emscripten target.| Python Enhancement Proposals (PEPs)
This PEP describes a proposed syntax for creating interface objects in Python.| Python Enhancement Proposals (PEPs)
This PEP provides the technical specification for the match statement. It replaces PEP 622, which is hereby split in three parts:| Python Enhancement Proposals (PEPs)
This PEP proposes a Python Packaging Council with broad authority over packaging standards, tools, and implementations. Like the Python Steering Council, the Packaging Council seeks to exercise this authority as rarely as possible; instead, they use thi...| Python Enhancement Proposals (PEPs)
This PEP outlines Python’s backwards compatibility policy.| Python Enhancement Proposals (PEPs)
PEP 508 specifies a mini-language for declaring package dependencies. One feature of this language is the ability to specify extras, which are optional components of a distribution that, when used, install additional dependencies. This PEP proposes a me...| Python Enhancement Proposals (PEPs)
Annotations are a Python technology that allows expressing type information and other metadata about Python functions, classes, and modules. But Python’s original semantics for annotations required them to be eagerly evaluated, at the time the annotate...| Python Enhancement Proposals (PEPs)
PEP 3107 introduced syntax for function annotations, but the semantics were deliberately left undefined. PEP 484 introduced a standard meaning to annotations: type hints. PEP 526 defined variable annotations, explicitly tying them with the type hintin...| Python Enhancement Proposals (PEPs)
This PEP proposes the addition of a module for common security-related functions such as generating tokens to the Python standard library.| Python Enhancement Proposals (PEPs)
This PEP proposes adding a zero-overhead debugging interface to CPython that allows debuggers and profilers to safely attach to running Python processes. The interface provides safe execution points for attaching debugger code without modifying the inte...| Python Enhancement Proposals (PEPs)
PEP 589 defines the structural type TypedDict for dictionaries with a fixed set of keys. As TypedDict is a mutable type, it is difficult to correctly annotate methods which accept read-only parameters in a way that doesn’t prevent valid inputs.| Python Enhancement Proposals (PEPs)
This PEP proposes adding the ability to mark a particular file download on a simple repository as “yanked”. Yanking a file allows authors to effectively delete a file, without breaking things for people who have pinned to exactly a specific version.| Python Enhancement Proposals (PEPs)
While distutils / setuptools have taken us a long way, they suffer from three serious problems: (a) they’re missing important features like usable build-time dependency declaration, autoconfiguration, and even basic ergonomic niceties like DRY-compliant...| Python Enhancement Proposals (PEPs)
The “Simple Repository API” that was defined in PEP 503 (and was in use much longer than that) has served us reasonably well for a very long time. However, the reliance on using HTML as the data exchange mechanism has several shortcomings.| Python Enhancement Proposals (PEPs)
This PEP specifies a way for organizations to reserve package name prefixes for future uploads.| Python Enhancement Proposals (PEPs)
This PEP proposed a list of standard library modules to be removed from the standard library. The modules are mostly historic data formats (e.g. Commodore and SUN file formats), APIs and operating systems that have been superseded a long time ago (e.g. ...| Python Enhancement Proposals (PEPs)
This PEP specifies a file format to specify the list of Python package installation requirements for an application, and the relation between the specified requirements. The list of requirements is considered exhaustive for the installation target, and ...| Python Enhancement Proposals (PEPs)
This PEP proposes the creation of a manylinux2010 platform tag to succeed the manylinux1 tag introduced by PEP 513. It also proposes that PyPI and pip both be updated to support uploading, downloading, and installing manylinux2010 distributions on comp...| Python Enhancement Proposals (PEPs)
This PEP proposes the creation of a new platform tag for Python package built distributions, such as wheels, called manylinux1_{x86_64,i686} with external dependencies limited to a standardized, restricted subset of the Linux kernel and core userspace A...| Python Enhancement Proposals (PEPs)
This PEP specifies a tagging system to indicate with which versions of Python a built or binary distribution is compatible. A set of three tags indicate which Python implementation and language version, ABI, and platform a built distribution requires. ...| Python Enhancement Proposals (PEPs)
Earlier this year, an experimental “just-in-time” compiler was merged into CPython’s main development branch. While recent CPython releases have included other substantial internal changes, this addition represents a particularly significant departure f...| Python Enhancement Proposals (PEPs)
PEP 691 defined a JSON form for the “Simple Repository API”. This allowed clients to more easily query the data that was previously only available in HTML, as defined in PEP 503.| Python Enhancement Proposals (PEPs)
This PEP proposes adding an anchor tag to expose the METADATA file from distributions in the PEP 503 “simple” repository API. A data-dist-info-metadata attribute is introduced to indicate that the file from a given distribution can be independently fetc...| Python Enhancement Proposals (PEPs)
Initially PEP 484 was designed in such way that it would not introduce any changes to the core CPython interpreter. Now type hints and the typing module are extensively used by the community, e.g. PEP 526 and PEP 557 extend the usage of type hints, and ...| Python Enhancement Proposals (PEPs)
Historically, Python uses the ANSI APIs for interacting with the Windows operating system, often via C Runtime functions. However, these have been long discouraged in favor of the UTF-16 APIs. Within the operating system, all text is represented as UTF-...| Python Enhancement Proposals (PEPs)
This PEP proposes a new special form, TypeIs, to allow annotating functions that can be used to narrow the type of a value, similar to the builtin isinstance(). Unlike the existing typing.TypeGuard special form, TypeIs can narrow the type in both the if...| Python Enhancement Proposals (PEPs)
This PEP renames the metadata provided by PEP 658 in both HTML and JSON formats of the Simple API and provides guidelines for both clients and servers in how to handle the renaming.| Python Enhancement Proposals (PEPs)
This PEP proposes a collection of changes related to the upload and distribution of digitally signed attestations and metadata used to verify them on a Python package repository, such as PyPI.| Python Enhancement Proposals (PEPs)
This PEP proposes to add to Python a mechanism for lightweight “virtual environments” with their own site directories, optionally isolated from system site directories. Each virtual environment has its own Python binary (allowing creation of environmen...| Python Enhancement Proposals (PEPs)
This PEP proposes adding Android as a supported platform in CPython. The initial goal is for Android to achieve Tier 3 support in Python 3.13.| Python Enhancement Proposals (PEPs)
A long-standing practical problem for Python users has been conflicts between OS package managers and Python-specific package management tools like pip. These conflicts include both Python-level API incompatibilities and conflicts over file ownership.| Python Enhancement Proposals (PEPs)
PEP 484 introduced TypeVar, enabling creation of generics parameterised with a single type. In this PEP, we introduce TypeVarTuple, enabling parameterisation with an arbitrary number of types - that is, a variadic type variable, enabling variadic generi...| Python Enhancement Proposals (PEPs)
Type hints introduced in PEP 484 can be used to specify type metadata for static type checkers and other third party tools. However, PEP 484 only specifies the semantics of nominal subtyping. In this PEP we specify static and runtime semantics of protoc...| Python Enhancement Proposals (PEPs)
Currently the CPython runtime maintains a small amount of mutable state in the allocated memory of each object. Because of this, otherwise immutable objects are actually mutable. This can have a large negative impact on CPU and memory performance, esp...| Python Enhancement Proposals (PEPs)
PEP 484 defines the type Dict[K, V] for uniform dictionaries, where each value has the same type, and arbitrary key values are supported. It doesn’t properly support the common pattern where the type of a dictionary value depends on the string value of...| Python Enhancement Proposals (PEPs)
Python Enhancement Proposals (PEPs)| Python Enhancement Proposals (PEPs)
This PEP specifies a mechanism for storing package requirements in pyproject.toml files such that they are not included in any built distribution of the project.| Python Enhancement Proposals (PEPs)
This PEP proposes to add a new module, interpreters, to support inspecting, creating, and running code in multiple interpreters in the current process. This includes Interpreter objects that represent the underlying interpreters. The module will also ...| Python Enhancement Proposals (PEPs)
This PEP lays out the theory referenced by PEP 484.| Python Enhancement Proposals (PEPs)
This PEP introduces a syntax for adding arbitrary metadata annotations to Python functions 1.| Python Enhancement Proposals (PEPs)
This document describes a PEP 517 style method for the installation of packages in editable mode.| Python Enhancement Proposals (PEPs)
PEP 557 introduced the dataclass to the Python stdlib. Several popular libraries have behaviors that are similar to dataclasses, but these behaviors cannot be described using standard type annotations. Such projects include attrs, pydantic, and object r...| Python Enhancement Proposals (PEPs)
This PEP describes an addition to the standard library called Data Classes. Although they use a very different mechanism, Data Classes can be thought of as “mutable namedtuples with defaults”. Because Data Classes use normal class definition syntax, y...| Python Enhancement Proposals (PEPs)
This PEP proposes a new mechanism in the functools standard library module that provides a simple form of generic programming known as single-dispatch generic functions.| Python Enhancement Proposals (PEPs)
This PEP specifies the language used to describe dependencies for packages. It draws a border at the edge of describing a single dependency - the different sorts of dependencies and when they should be installed is a higher level problem. The intent is ...| Python Enhancement Proposals (PEPs)
This document describes a change in the release calendar for Python starting with Python 3.9. This change accelerates the release cadence such that feature versions are released predictably every twelve months, in October every year.| Python Enhancement Proposals (PEPs)
This PEP describes a mechanism for publishing and exchanging metadata related to Python distributions. It includes specifics of the field names, and their semantics and usage.| Python Enhancement Proposals (PEPs)
This PEP recommends deprecating and then disabling new uploads of the bdist_egg distribution type on PyPI. In a parallel move, this PEP recommends deprecating and then disabling new uploads of distribution filenames that have the .egg suffix.| Python Enhancement Proposals (PEPs)
Long time Pythoneer Tim Peters succinctly channels the BDFL’s guiding principles for Python’s design into 20 aphorisms, only 19 of which have been written down.| Python Enhancement Proposals (PEPs)
Python supports multiple ways to format text strings. These include %-formatting 1, str.format() 2, and string.Template 3. Each of these methods have their advantages, but in addition have disadvantages that make them cumbersome to use in practice. This...| Python Enhancement Proposals (PEPs)
This PEP proposes a change to generators: when StopIteration is raised inside a generator, it is replaced with RuntimeError. (More precisely, this happens when the exception is about to bubble out of the generator’s stack frame.) Because the change is ...| Python Enhancement Proposals (PEPs)
This PEP proposes to introduce a syntax to declare the encoding of a Python source file. The encoding information is then used by the Python parser to interpret the file using the given encoding. Most notably this enhances the interpretation of Unicode ...| Python Enhancement Proposals (PEPs)
This PEP specifies how to write a project’s core metadata in a pyproject.toml file for packaging-related tools to consume.| Python Enhancement Proposals (PEPs)
This PEP specifies how Python software packages should specify what build dependencies they have in order to execute their chosen build system. As part of this specification, a new configuration file is introduced for software packages to use to specify...| Python Enhancement Proposals (PEPs)
PEP 484 introduced type hints, a.k.a. type annotations. While its main focus was function annotations, it also introduced the notion of type comments to annotate variables:| Python Enhancement Proposals (PEPs)
File names, environment variables, and command line arguments are defined as being character data in POSIX; the C APIs however allow passing arbitrary bytes - whether these conform to a certain encoding or not. This PEP proposes a means of dealing with ...| Python Enhancement Proposals (PEPs)
This PEP introduces a simple and intuitive way to annotate methods that return an instance of their class. This behaves the same as the TypeVar-based approach specified in PEP 484 but is more concise and easier to follow.| Python Enhancement Proposals (PEPs)
There is currently no way to specify, using type annotations, that a function parameter can be of any literal string type. We have to specify a precise literal string type, such as Literal["foo"]. This PEP introduces a supertype of literal string types:...| Python Enhancement Proposals (PEPs)
This PEP proposes a new system for built-in string formatting operations, intended as a replacement for the existing ‘%’ string formatting operator.| Python Enhancement Proposals (PEPs)
The growth of Internet and general connectivity has triggered the proportionate need for responsive and scalable code. This proposal aims to answer that need by making writing explicitly asynchronous, concurrent Python code easier and more Pythonic.| Python Enhancement Proposals (PEPs)
A syntax is proposed for a generator to delegate part of its operations to another generator. This allows a section of code containing ‘yield’ to be factored out and placed in another generator. Additionally, the subgenerator is allowed to return with ...| Python Enhancement Proposals (PEPs)
This PEP proposes some enhancements to the API and syntax of generators, to make them usable as simple coroutines. It is basically a combination of ideas from these two PEPs, which may be considered redundant if this PEP is accepted:| Python Enhancement Proposals (PEPs)
The import statement has two problems:| Python Enhancement Proposals (PEPs)
Since Python 1.5 (1997), CPython users can run multiple interpreters in the same process. However, interpreters in the same process have always shared a significant amount of global state. This is a source of bugs, with a growing impact as more and mo...| Python Enhancement Proposals (PEPs)
This PEP documents the semantics and conventions associated with Python docstrings.| Python Enhancement Proposals (PEPs)
This PEP proposes a new contextvars module and a set of new CPython C APIs to support context variables. This concept is similar to thread-local storage (TLS), but, unlike TLS, it also allows correctly keeping track of values per asynchronous task, e.g...| Python Enhancement Proposals (PEPs)