You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reflective dunder methods are called when the normal dunder fails.
This normally does not matter for commutative operations, like addition,
but for division and subtraction, this can lead to errors.
For example,
def __sub__(self, other)
is meant to solve `self - other`
while
def __rsub__(self, other)
is meant to solve `other - self`
The following reflective dunder methods were fixed to honor
the correct direction of operations:
__rsub__
__rfloordiv__
__rtruediv__
__rmod__
__rpow__
0 commit comments