4 ms·
1. operators use special lookup for dunder methods--on class, not on instance: >>> a+1 # lookup on class 1+1 2 >>> a.__add__(1) # instance me
by d0mine 1y ago
1. operators use special lookup for dunder methods--on class, not on instance:
>>> a+1 # lookup on class
1+1
2
>>> a.__add__(1) # instance method
0
2. There is __radd__ that is called if __add__ doesn't support given types (for different types).