PEP 572

GPTKB entity

Statements (76)
Predicate Object
gptkbp:instance_of gptkb:Library
gptkbp:abstract Introduce the assignment expression.
gptkbp:allows inline assignment
gptkbp:approves gptkb:Python_Steering_Council
gptkbp:author gptkb:Guido_van_Rossum
gptkb:Brandon_Rhodes
gptkbp:benefits Potential misuse.
Reduces redundancy.
gptkbp:caused_by To allow assignment within expressions.
To allow assignments to be made within expressions.
gptkbp:code Encourages concise coding.
gptkbp:created July 2018
2018-08-27
2016-08-02
gptkbp:decided_by Approved.
gptkbp:discusses Discussed in Python community.
Python mailing list.
https://discuss.python.org/t/pep-572-assignment-expressions/
gptkbp:ends_at gptkb:Python_3.8
Accepted and implemented.
gptkbp:example Used in list comprehensions.
if (n := len(a)) > 10.
x := 10.
if (n := len(a)) > 10:
gptkbp:features gptkb:walrus_operator
gptkbp:feedback Mixed responses.
gptkbp:formulation := operator.
Conditional expressions.
x := expr
gptkbp:future_plans Further enhancements.
https://www.w3.org/2000/01/rdf-schema#label PEP 572
gptkbp:impact Simplifies certain coding patterns.
gptkbp:introduced gptkb:walrus_operator
the assignment expression (walrus operator)
gptkbp:is_adopted_by Widely adopted in Python 3.8.
gptkbp:is_considered a significant feature
gptkbp:is_criticized_for Concerns about readability.
potential readability issues
gptkbp:is_described_as walrus operator for assignment expressions
Introduces the assignment expression syntax.
gptkbp:is_documented_in Python documentation
gptkbp:is_essential_for Python syntax enhancements
gptkbp:is_implemented_in Python interpreter
Completed.
Implemented in C Python.
gptkbp:is_known_for the walrus operator
gptkbp:is_maintained_by gptkb:Library
gptkbp:is_motivated_by Improve code clarity.
gptkbp:is_noted_for its syntactic sugar
gptkbp:is_part_of Python syntax enhancements
gptkbp:is_referenced_in https://www.python.org/dev/peps/pep-0572/
gptkbp:is_related_to Python syntax
gptkbp:is_reviewed_by gptkb:Python_core_developers
gptkbp:is_supported_by gptkb:Library
gptkbp:is_used_in Python 3.8 and later
gptkbp:keywords gptkb:walrus_operator
gptkbp:latest_version 3.8
572.0
3.8.0.
gptkbp:plot_summary Introduces assignment expressions.
gptkbp:proposed_by Python community members
gptkbp:published_by August 2020
gptkbp:received 2018-09-04
August 2018
gptkbp:related_concept Lambda functions.
gptkbp:related_to Python syntax
PEP 572.
gptkbp:related_works gptkb:PEP_8
gptkbp:replaced_by gptkb:None
gptkbp:status gptkb:Final
gptkbp:title Assignment Expressions
gptkbp:uses Used in loops and comprehensions.
gptkbp:was_a_proponent_of Guido van Rossum.
gptkbp:written_by gptkb:Chris_Angelico
gptkbp:bfsParent gptkb:PEP_8
gptkbp:bfsLayer 5