
March 5, 2019
6:30 p.m.
2019-03-05 0:34 UTC+01:00, Brandt Bucher <brandtbucher@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@python.org>:
Yes. The same happens for lists. [1] + 'a' is a TypeError, but a += 'a' works:
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.