The "walrus operator" is an informal term for the assignment expression syntax (a := b) that were proposed in PEP 572 and introduced in Python 3.8
After acceptance of PEP 572, python-3.8 introduced assignment expressions, which are a way to assign to variables within an expression using the notation NAME := expr
. Given the resemblance between :=
and an emoticon of eyes plus walrus tusks, the syntax is sometimes known as the "walrus operator", a term coined in the PEP.