PEP 3107

E911261

PEP 3107 is the Python Enhancement Proposal that introduced function annotations, providing a standardized syntax for attaching metadata such as type information to function parameters and return values.

All labels observed (1)

Label Occurrences
PEP 3107 canonical 2

How this entity was disambiguated

Statements (44)

Predicate Object
instanceOf Python Enhancement Proposal ⓘ
acceptedBy Python core developers ⓘ
allows any Python expression as an annotation ⓘ
annotationStorage __annotations__ attribute on functions ⓘ
author Guido van Rossum ⓘ
backwardsCompatibility does not change function call semantics ⓘ
created 2006-03-05 ⓘ
defines syntax for attaching metadata to function parameters ⓘ
syntax for attaching metadata to function return values ⓘ
designGoal allow arbitrary metadata on function parameters ⓘ
avoid enforcing a specific type system ⓘ
keep annotations optional ⓘ
doesNotSpecify how tools should interpret annotations ⓘ
implementedInVersion Python 3.0 ⓘ
linked to: Python 3.x
influenced PEP 484 ⓘ
Python type hinting ecosystem ⓘ
introducedFeature function annotations ⓘ
introducedSyntax parameter annotations ⓘ
return value annotations ⓘ
language Python ⓘ
metadataKind documentation metadata ⓘ
type information ⓘ
validation metadata ⓘ
motivatedBy need for standardized way to attach metadata to functions ⓘ
primaryUseCase documentation ⓘ
static analysis ⓘ
type information ⓘ
proposalNumber 3107 ⓘ
pythonVersionIntroduced Python 3.0 ⓘ
linked to: Python 3.x
relatedTo PEP 484 ⓘ
PEP 526 ⓘ
PEP 563 ⓘ
PEP 649 ⓘ
replaces earlier informal annotation proposals ⓘ
scope function definitions ⓘ
method definitions ⓘ
semantics annotations are available for introspection ⓘ
annotations have no runtime effect by default ⓘ
status Final ⓘ
syntaxExample def f(x: int) -> str: ... ⓘ
targetAudience Python developers ⓘ
title Function Annotations ⓘ
type Standards Track ⓘ
url https://peps.python.org/pep-3107/ ⓘ

How these facts were elicited

Referenced by (2)

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

PEP 484 → relatedTo → PEP 3107 ⓘ
PEP 526 → relatedTo → PEP 3107 ⓘ