2016-11-14 19:40 GMT-08:00 MRAB <pyt...@mrabarnett.plus.com>: > 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)'.
Or to be even more pedantic, `a = type(a).__iadd__(a, 1)`. > > > _______________________________________________ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/