[Python-ideas] Reverse assignment operators (=+, =-, =*, =/, =//, =**, =%)

MRAB python at mrabarnett.plus.com
Mon Nov 14 22:40:12 EST 2016


On 2016-11-15 02:59, Matthias welp wrote:
[snip]

> e.g. if you use 'a = a + 1', python under the hood interprets it as
> 'a = a.__add__(1)', but if you use 'a += 1' it uses 'a.__iadd__(1)'.

FTR, 'a += 1' is interpreted as 'a = a.__iadd__(1)'.



More information about the Python-ideas mailing list