PEP 526

E911262

PEP 526 is a Python Enhancement Proposal that introduced a standard syntax for variable and attribute type annotations in Python.

Try in SPARQL Jump to: Surface forms Statements Referenced by

All labels observed (1)

Label Occurrences
PEP 526 canonical 1

Statements (35)

Predicate Object
instanceOf Python Enhancement Proposal
affects static type checking in Python
allows annotations for class attributes
annotations for instance attributes
annotations for module-level variables
author Guido van Rossum NERFINISHED
Jukka Lehtosalo NERFINISHED
Łukasz Langa NERFINISHED
bdflDelegate Guido van Rossum NERFINISHED
category Typing
clarifies that annotations have no runtime effect by default
created 2016-09-07
defines syntax for attribute annotations
syntax for variable annotations
discussedOn python-dev mailing list NERFINISHED
exampleSyntax primes: List[int] = []
self.name: str
x: int = 0
influenced subsequent typing-related PEPs
introducedInPythonVersion Python 3.6 NERFINISHED
language Python NERFINISHED
motivation standardize syntax for type annotations on variables and attributes
number 526
relatedTo PEP 3107 NERFINISHED
PEP 484 NERFINISHED
replaces comment-based type hints for variables
requires support from type checkers like mypy
scope syntax only, not type system semantics
specifies storage of annotations in __annotations__ mapping
status Final
title Syntax for Variable Annotations NERFINISHED
topic attribute annotations
type annotations
variable annotations
url https://peps.python.org/pep-0526/

Referenced by (1)

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

PEP 484 relatedTo PEP 526