PEP 649
E918446
PEP 649 is a Python enhancement proposal that introduces a new, lazy evaluation scheme for type annotations to improve performance and forward-reference handling.
Statements (43)
| Predicate | Object |
|---|---|
| instanceOf | Python Enhancement Proposal ⓘ |
| affects |
class annotations
ⓘ
function annotations ⓘ module-level annotations ⓘ |
| aimsTo |
improve handling of forward references in annotations
ⓘ
improve performance of type annotations ⓘ |
| author | Brett Cannon NERFINISHED ⓘ |
| belongsTo | Python type system evolution ⓘ |
| category |
Language Design
ⓘ
Typing ⓘ |
| created | 2020-01-13 ⓘ |
| defines | descriptor-based protocol for accessing annotations ⓘ |
| discusses |
backwards compatibility for annotations
ⓘ
impact on introspection tools ⓘ interaction with typing module ⓘ migration path from PEP 563 semantics ⓘ runtime cost of evaluating annotations ⓘ |
| goal | make annotations cheaper at runtime while remaining usable for tooling ⓘ |
| intendedAudience |
Python core developers
ⓘ
library and framework authors using annotations ⓘ static type checker implementers ⓘ typing library authors ⓘ |
| language | Python NERFINISHED ⓘ |
| modifies | semantics of __annotations__ ⓘ |
| motivation |
avoid eager evaluation of annotations at function definition time
ⓘ
provide reliable access to unevaluated annotation expressions ⓘ |
| notes | stringized annotations from PEP 563 caused practical issues ⓘ |
| number | 649 ⓘ |
| proposes |
deferred evaluation of annotations
ⓘ
lazy evaluation of type annotations ⓘ |
| relatedTo |
PEP 563
NERFINISHED
ⓘ
PEP 649 alternative proposals for annotations ⓘ PEP 695 NERFINISHED ⓘ |
| replaces | PEP 563 NERFINISHED ⓘ |
| repository | https://peps.python.org/pep-0649/ ⓘ |
| scope | runtime semantics of annotations, not static typing rules ⓘ |
| status | Withdrawn ⓘ |
| supersedes | PEP 563: Postponed Evaluation of Annotations NERFINISHED ⓘ |
| targetsVersion | Python 3.x NERFINISHED ⓘ |
| title | Deferred Evaluation Of Annotations Using Descriptors NERFINISHED ⓘ |
| usesMechanism | descriptors for annotation evaluation ⓘ |
| withdrawnInFavorOf |
PEP 649 alternative design adopted in PEP 649 withdrawal rationale
ⓘ
PEP 695 NERFINISHED ⓘ |
Referenced by (1)
Full triples — surface form annotated when it differs from this entity's canonical label.