PEP 544

E939794

PEP 544 is a Python Enhancement Proposal that introduces structural subtyping via typing.Protocol, enabling static type checkers to support interface-like behavior based on object capabilities rather than inheritance.

All labels observed (1)

Label Occurrences
PEP 544 canonical 9

How this entity was disambiguated

Statements (47)

Predicate Object
instanceOf Python Enhancement Proposal ⓘ
affectsModule typing ⓘ
allows runtime isinstance checks for some protocols ⓘ
subtyping based on method signatures ⓘ
subtyping without explicit inheritance ⓘ
availableVia typing_extensions in older Python versions ⓘ
buildsOn PEP 484 ⓘ
PEP 526 ⓘ
category Typing ⓘ
clarifies relationship between ABCs and protocols ⓘ
compatibleWith Pyright ⓘ
mypy ⓘ
other PEP 484-style type checkers ⓘ
contrastsWith nominal subtyping ⓘ
createdForVersion Python 3 ⓘ
linked to: Python 3.x
defines protocols for static typing ⓘ
definesSyntaxElement Protocol base class ⓘ
runtime_checkable decorator ⓘ
definesTerm protocol ⓘ
runtime protocol ⓘ
static protocol ⓘ
enables interface-like behavior based on object capabilities ⓘ
static duck typing ⓘ
focusesOn static type checking ⓘ
hasNumber 544 ⓘ
hasTitle Protocols: Structural subtyping (static duck typing) ⓘ
influences design of typing_extensions.Protocol ⓘ
introducesConcept structural subtyping ⓘ
typing.Protocol ⓘ
language Python ⓘ
mainFeature callback protocols ⓘ
generic protocols ⓘ
protocol inheritance ⓘ
runtime-checkable protocols ⓘ
subtyping based on object capabilities ⓘ
motivation better support for large code bases using duck typing ⓘ
provide standard way to define static protocols ⓘ
primaryMechanism typing.Protocol base class ⓘ
recommends using protocols instead of ABCs for some use cases ⓘ
status Final ⓘ
subtypingStyle structural ⓘ
supports interface-based programming style ⓘ
static type checkers ⓘ
type Standards Track ⓘ
useCase defining interfaces for libraries ⓘ
gradual typing of existing code ⓘ
static checking of duck-typed code ⓘ

How these facts were elicited

Referenced by (9)

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

PEP 484 → relatedTo → PEP 544 ⓘ
typing (Python module) → relatedPEP → PEP 544 ⓘ
subject linked to: typing
PEP 647 TypeGuard → relatedTo → PEP 544 ⓘ
typing → extendedByPEP → PEP 544 ⓘ
subject linked to: Python typing module
PEP 612 → relatedTo → PEP 544 ⓘ
PEP 613 → buildsOn → PEP 544 ⓘ
PEP 483 → relatedTo → PEP 544 ⓘ
PEP 647 → relatedTo → PEP 544 ⓘ
PEP 560 → relatedTo → PEP 544 ⓘ