[Python-Dev] PEP 572: Assignment Expressions

Ethan Furman ethan at stoneleaf.us
Tue Apr 17 11:12:09 EDT 2018


On 04/17/2018 06:26 AM, Paul Moore wrote:

> I should also point out that I remain -0 on this proposal (I'd already
> said this on python-ideas, but I should probably repeat it here). For
> me, the use cases are mostly marginal, and the major disadvantage is
> in having two forms of assignment. Explaining to a beginner why we use
> a := b in an expression, but a = b in a statement is going to be a
> challenge.

I don't see the challenge:  They are different because '=' came first, but using '=' in an expression is a common source 
of bugs, so there we use ':=' instead.

--
~Ethan~


More information about the Python-Dev mailing list