[Python-ideas] PEP: Dict addition and subtraction
delgan.py at gmail.com
Tue Mar 5 13:30:46 EST 2019
2019-03-05 0:34 UTC+01:00, Brandt Bucher <brandtbucher at gmail.com>:
>> Is there other built-in types which act differently if called with
>> the operator or augmented assignment version?
> list.__iadd__ and list.extend
2019-03-05 0:57 UTC+01:00, Guido van Rossum <guido at python.org>:
> Yes. The same happens for lists.  + 'a' is a TypeError, but a += 'a'
Oh, I can't believe I'm learning that just today while I'm using
Python since years.
Thanks for the clarification. This makes perfect sense for += to
behaves like .update() then.
More information about the Python-ideas