PEP 585

E265442

PEP 585 is a Python Enhancement Proposal that introduced built-in generic types (like list[int] and dict[str, int]) as a modern replacement for many typing module aliases.

All labels observed (1)

Label Occurrences
PEP 585 canonical 9

How this entity was disambiguated

Statements (48)

Predicate Object
instanceOf Python Enhancement Proposal ⓘ
affectsModule builtins ⓘ
collections.abc ⓘ
typing ⓘ
author Guido van Rossum ⓘ
Jelle Zijlstra ⓘ
backwardsCompatibility typing aliases remain for older Python versions ⓘ
clarifies that built-in generics are mainly for static type checkers ⓘ
created 2019-10-13 ⓘ
defines dict[str, int] as generic built-in type ⓘ
frozenset[int] as generic built-in type ⓘ
list[int] as generic built-in type ⓘ
set[int] as generic built-in type ⓘ
tuple[int, str] as generic built-in type ⓘ
type[list] as supporting subscription for generics ⓘ
discourages use of typing.Dict for new code ⓘ
use of typing.FrozenSet for new code ⓘ
use of typing.List for new code ⓘ
use of typing.Set for new code ⓘ
use of typing.Tuple for new code ⓘ
discusses performance considerations of generic built-ins ⓘ
runtime behavior of parameterized built-in types ⓘ
introduces PEP 560-style internal implementation for generics in built-ins ⓘ
motivation Provide built-in generic types for standard collections ⓘ
Reduce reliance on typing module aliases for standard collections ⓘ
number 585 ⓘ
pythonVersionIntroduced Python 3.9 ⓘ
rationale Avoid confusion between typing.List and built-in list ⓘ
Make type hints more concise and consistent with runtime types ⓘ
replaces typing.Dict ⓘ
typing.FrozenSet ⓘ
typing.List ⓘ
typing.Set ⓘ
typing.Tuple ⓘ
typing.Type ⓘ
replacesPattern from typing import Dict with dict[...] syntax ⓘ
from typing import FrozenSet with frozenset[...] syntax ⓘ
from typing import List with list[...] syntax ⓘ
from typing import Set with set[...] syntax ⓘ
from typing import Tuple with tuple[...] syntax ⓘ
requires that standard collections support __class_getitem__ ⓘ
status Final ⓘ
targetAudience Python application developers using type hints ⓘ
Python library authors ⓘ
Python type checker implementers ⓘ
title Type Hinting Generics In Standard Collections ⓘ
type Standards Track ⓘ
url https://peps.python.org/pep-0585/ ⓘ

How these facts were elicited

Referenced by (9)

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

PEP 695 → relatedTo → PEP 585 ⓘ
Standards Track PEPs → example → PEP 585 ⓘ
typing (Python module) → relatedPEP → PEP 585 ⓘ
subject linked to: typing
typing → extendedByPEP → PEP 585 ⓘ
subject linked to: Python typing module
PEP 613 → relatedTo → PEP 585 ⓘ
PEP 560 → relatedTo → PEP 585 ⓘ
PEP 604 → relatedTo → PEP 585 ⓘ