PEP 604

E901490

PEP 604 is a Python Enhancement Proposal that introduced the modern, concise syntax for expressing type unions (using the `|` operator) in Python’s type hints.

All labels observed (1)

Label Occurrences
PEP 604 canonical 7

How this entity was disambiguated

Statements (36)

Predicate Object
instanceOf Python Enhancement Proposal ⓘ
acceptedBy Python core developers ⓘ
affects Python type hinting system ⓘ
appliesTo typing.Optional via X | None ⓘ
author Jelle Zijlstra ⓘ
Pradeep Kumar Srinivasan ⓘ
Łukasz Langa ⓘ
category Typing ⓘ
clarifies how unions are represented at runtime ⓘ
interaction of | with existing typing constructs ⓘ
createdForVersion Python 3.10 ⓘ
defines behavior of | operator on types at runtime ⓘ
semantics of X | Y for typing ⓘ
discusses backwards compatibility of union syntax ⓘ
documentedAt https://peps.python.org/pep-0604/ ⓘ
governs syntax of union types in standard library type hints ⓘ
hasNumber 604 ⓘ
hasTitle Allow writing union types as X | Y ⓘ
influences type checkers such as Pyre ⓘ
type checkers such as mypy ⓘ
type checkers such as pyright ⓘ
introducedIn Python 3.10 ⓘ
language Python ⓘ
motivation make type hints more readable ⓘ
reduce verbosity of typing.Union ⓘ
proposesFeature modern concise syntax for type unions ⓘ
using | operator for type unions in type hints ⓘ
recommends preferring X | Y over typing.Union[X, Y] in new code ⓘ
relatedTo PEP 563 ⓘ
PEP 585 ⓘ
PEP 649 ⓘ
replacesSyntax typing.Union[X, Y] with X | Y ⓘ
scope static type checking ⓘ
standardizes use of | for unions across typing ecosystem ⓘ
status Final ⓘ
usesOperator bitwise or operator | ⓘ

How these facts were elicited

Referenced by (7)

Full triples — surface form annotated when it differs from this entity's canonical label.

Python 3.10 → implementsPEP → PEP 604 ⓘ
typing (Python module) → relatedPEP → PEP 604 ⓘ
subject linked to: typing
typing → extendedByPEP → PEP 604 ⓘ
subject linked to: Python typing module
PEP 612 → relatedTo → PEP 604 ⓘ
PEP 613 → relatedTo → PEP 604 ⓘ