PEP 572
E51179
PEP 572 is the Python proposal that introduced the “walrus operator” (:=) for assignment expressions, allowing assignment within larger expressions.
All labels observed (4)
| Label | Occurrences |
|---|---|
| PEP 572 canonical | 6 |
| PEP 572 sparked significant discussion in the Python community | 1 |
| PEP 572: Assignment Expressions | 1 |
| walrus operator (:=) | 1 |
How this entity was disambiguated
This entity first appeared as the object of triple T400417 — resolving that mention is where its identity was fixed. The disambiguator weighed these candidate entities and picked the highlighted one (or “None”, minting a new entity). This is how homonymy is resolved: the same surface form can point to different entities.
Target entity: PEP 572 Context triple: [Python Enhancement Proposals, hasPart, PEP 572]
-
A.
Python Enhancement Proposals
Python Enhancement Proposals (PEPs) are the formal design documents that propose, specify, and document new features, processes, and standards for the Python programming language.
-
B.
PEP 0
PEP 0 is the index document that lists and tracks the status of all Python Enhancement Proposals (PEPs) in the Python community.
-
C.
Python Steering Council
The Python Steering Council is the core governance body responsible for guiding the development and direction of the Python programming language.
-
D.
Stackless Python
Stackless Python is an enhanced version of the Python interpreter that provides lightweight microthreads and improved concurrency support without relying on the C call stack.
-
E.
PyPy
PyPy is a high-performance alternative Python interpreter featuring a Just-In-Time (JIT) compiler designed to significantly speed up the execution of Python programs.
- F. None of above. chosen
- G. Unsure - the case is ambiguous/there is not enough information to decide.
Target entity: PEP 572 Target entity description: PEP 572 is the Python proposal that introduced the “walrus operator” (:=) for assignment expressions, allowing assignment within larger expressions.
-
A.
Python Enhancement Proposals
Python Enhancement Proposals (PEPs) are the formal design documents that propose, specify, and document new features, processes, and standards for the Python programming language.
-
B.
PEP 0
PEP 0 is the index document that lists and tracks the status of all Python Enhancement Proposals (PEPs) in the Python community.
-
C.
Python Steering Council
The Python Steering Council is the core governance body responsible for guiding the development and direction of the Python programming language.
-
D.
Stackless Python
Stackless Python is an enhanced version of the Python interpreter that provides lightweight microthreads and improved concurrency support without relying on the C call stack.
-
E.
PyPy
PyPy is a high-performance alternative Python interpreter featuring a Just-In-Time (JIT) compiler designed to significantly speed up the execution of Python programs.
- F. None of above. chosen
Statements (48)
| Predicate | Object |
|---|---|
| instanceOf | Python Enhancement Proposal ⓘ |
| affectsComponent |
Python compiler
ⓘ
Python language syntax ⓘ |
| author | Chris Angelico ⓘ |
| bdfDelegate | Guido van Rossum ⓘ |
| category | Python syntax change ⓘ |
| controversy |
contributed to Guido van Rossum stepping down as BDFL
ⓘ
sparked debate in the Python community about readability ⓘ |
| created | 2018-02-25 ⓘ |
| decisionProcess | BDFL-delegate model ⓘ |
| definesSyntax | NAME ":=" expression ⓘ |
| designGoal |
avoid ambiguity with existing assignment syntax
ⓘ
keep assignment expressions visually distinct from equality tests ⓘ |
| disallowsContext |
assignment expressions at top level of comprehension target list
ⓘ
assignment expressions in some lambda parameter positions ⓘ |
| discussedOn |
python-dev mailing list
ⓘ
python-ideas mailing list ⓘ |
| examplePattern |
[y := f(x) for x in data if y > 0]
ⓘ
if (m := pattern.search(data)) is not None: ... ⓘ while (line := file.readline()) != "": ... ⓘ |
| firstAppearedInVersion | Python 3.8 ⓘ |
| governingBody | Python core developers ⓘ |
| introducedFeature | assignment expressions ⓘ |
| introducedOperator | walrus operator ⓘ |
| introducedSymbol | := ⓘ |
| language | Python ⓘ |
| motivation |
allow assignment within larger expressions
ⓘ
improve readability for some conditional and comprehension constructs ⓘ reduce code duplication in certain patterns ⓘ |
| number | 572 ⓘ |
| pepUrl | https://peps.python.org/pep-0572/ ⓘ |
| referenceImplementation |
Python reference implementation (CPython)
ⓘ
surface form:
CPython 3.8
|
| relatedConcept |
assignment
ⓘ
comprehensions ⓘ control flow ⓘ expressions ⓘ |
| relatedPEP | PEP 8 ⓘ |
| repository | https://github.com/python/peps ⓘ |
| requiresVersionAtLeast | Python 3.8 ⓘ |
| sponsor | Guido van Rossum ⓘ |
| status | Final ⓘ |
| syntaxChoiceReason | use of := inspired by languages like Go and Pascal ⓘ |
| title | Assignment Expressions ⓘ |
| type | Standards Track ⓘ |
| useCase |
if statements that test and capture a value
ⓘ
list comprehensions with reused subexpressions ⓘ regular expression matches stored in a variable ⓘ while loops that both test and assign ⓘ |
How these facts were elicited
The pipeline generated the facts above by prompting gpt-5.1 with this entity's name + description and the instruction below.
You are a knowledge base construction expert. Given a subject entity and a description of it, return factual statements that you know for the subject as a JSON list of dictionaries(triples), where keys must be "subject", "predicate" and "object". The number of facts may be very high, between 25 to 50 or more, for very popular subjects. For less popular subjects, the number of facts can be very low, like 5 or 10. # Requirements - If you don't know the subject at all, return an empty list. - If the subject is not a named entity, return an empty list. - Include at least one triple where predicate is "instanceOf". - Do not get too wordy. - Separate several objects into multiple triples with one object.
Subject: PEP 572 Description of subject: PEP 572 is the Python proposal that introduced the “walrus operator” (:=) for assignment expressions, allowing assignment within larger expressions.
Referenced by (9)
Full triples — surface form annotated when it differs from this entity's canonical label.