Closed
Description
See this discussion.
Normal NotImplemented situation : A() + B()
is resolved in A.__add__(A(), B())
which if returning NotImplemented, falls back to B.__radd__(B(), A())
.
Now this behavior means there can be a double fallback : in a += b
, if A.__iadd__
exists but returns NotImplemented, it will first fall back to A.__add__
and then to B.__radd__
.
This is a great feature, but it's not currently documented.