Difference between a+b and a.__add__(b)
<p>I am currently trying to understand where the difference between using <code>a+b</code> and <code>a.__add__(b)</code> is when it comes to custom classes. There are numerous websites that say that using the '+'-operator results in using the special method <code>__add__</code> - which is fine so far.</p>

<p>But when i run the following example I get two different results.</p>

<pre><code>class C:  
  def __add__(self, other):
    print("C.__add__", self, other)
    return "result"  
  def __radd__(self, other):
    print("C.__radd__", self, other)    
    return "reversed result"

c = C()
print(1+c)
print()
print(1 .__add__(c))
print(int.__add__(1,c))
</code></pre>

<p>Result:</p>

<pre><code>C.__radd__ &lt;C object at 0x7f60b92e9550&gt; 1
reversed result

NotImplemented
NotImplemented
</code></pre>

<p>Now from what I understood, when executing <code>1+c</code> Python checks/executes the int <code>__add__</code> method - finds that there is no implementation for adding int and C objects - returns NotImplemented - which lets Python know to check object C for <code>__radd__</code> and executes the code within.</p>

<p>Why does <code>1+c</code> result in executing the <code>__radd__</code> code but the other two version are just returning <code>NotImplemented</code> without checking <code>__radd__</code> ??</p>