Newest Python PEPs Python Enhancement Proposals (PEPs) - Information on new language features, and some meta-information like release procedure and schedulesWed, 23 Feb 2022 00:29:42 GMTPyRSS2Gen-1.1.0 683: Immortal Objects, Using a Fixed Refcount 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, especially for approaches to increasing Python's scalability. The solution proposed here provides a way to mark an object as one for which that per-object runtime state should not change.Eric Snow <>, Eddie Elizondo <>, 10 Feb 2022 00:00:00 GMTPEP 682: Format Specifier for Signed Zero float and Decimal types can represent signed zero, in many fields of mathematics negative zero is surprising or unwanted -- especially in the context of displaying an (often rounded) numerical result. This PEP proposes an extension to the string format specification allowing negative zero to be normalized to positive zero.John Belmonte <>, 29 Jan 2022 00:00:00 GMTPEP 679: Allow parentheses in assert statements PEP proposes to allow parentheses surrounding the two-argument form of assert statements. This will cause the interpreter to reinterpret what before would have been an assert with a two-element tuple that will always be True (assert (expression, message)) to an assert statement with a subject and a failure message, equivalent to the statement with the parentheses removed (assert expression, message).Pablo Galindo Salgado <>, 07 Jan 2022 00:00:00 GMTPEP 680: tomllib: Support for Parsing TOML in the Standard Library PEP proposes adding the tomllib module to the standard library for parsing TOML (Tom's Obvious Minimal Language, Hukkinen, Shantanu Jain <hauntsaninja at>, 01 Jan 2022 00:00:00 GMTPEP 678: Enriching Exceptions with Notes objects are typically initialized with a message that describes the error which has occurred. Because further information may be available when the exception is caught and re-raised, or included in an ExceptionGroup, this PEP proposes to add BaseException.add_note(note, *, replace=False), a .__notes__ attribute holding a tuple of zero or more notes so added, and to update the builtin traceback formatting code to include notes in the formatted traceback following the exception string.Zac Hatfield-Dodds <>, 20 Dec 2021 00:00:00 GMTPEP 677: Callable Type Syntax PEP introduces a concise and friendly syntax for callable types, supporting the same functionality as typing.Callable but with an arrow syntax inspired by the syntax for typed function signatures. This allows types like Callable[[int, str], bool] to be written as (int, str) -> bool.Steven Troxler <>,, 13 Dec 2021 00:00:00 GMTPEP 681: Data Class Transforms 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 relational mapper (ORM) packages such as Django and EdgeDB.Erik De Bonte <erikd at>,, 02 Dec 2021 00:00:00 GMTPEP 675: Arbitrary Literal String Type 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: LiteralString. This allows a function to accept arbitrary literal string types, such as Literal["foo"] or Literal["bar"].Pradeep Kumar Srinivasan <>, Graham Bleaney <>, 30 Nov 2021 00:00:00 GMTPEP 674: Disallow using macros as l-values using macros as l-values. For example, Py_TYPE(obj) = new_type now fails with a compiler error.Victor Stinner <>, 30 Nov 2021 00:00:00 GMTPEP 673: Self Type 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.Pradeep Kumar Srinivasan <>,, 10 Nov 2021 00:00:00 GMT