[Python-ideas] "Immutable Builder" Pattern and Operator

Ethan Furman ethan at stoneleaf.us
Mon Jan 23 10:51:58 EST 2017


On 01/23/2017 05:33 AM, Soni L. wrote:

> It's literally sugar for repeating the name and moving the dot to the right.
>  I think it's clearer than most other compound operators in that it doesn't
>  affect precedence rules.
>
> `x += y`, for any code `y`, is equivalent to `x = x + (y)`, not `x = x + y`.
>
> `x .= y`, for any code `y`, is equivalent to `x = x . y`, not `x = x . (y)`.

This is not an improvement.

--
~Ethan~


More information about the Python-ideas mailing list