title: Why is it called operator overloading and not overriding in Python?
body: <p>If I want to change the behavior of an inherited method, I would do something like this:</p>
  <pre><code>class a:
      def changeMe(self):
          print('called a')
  
  class b(a):
      def changeMe(self):
          print('called b')
  </code></pre>
  <p>I believe this is an example of <em>overriding</em> in Python.</p>
  <p>However, if I want to <em>overload</em> an operator, I do something very similar:</p>
  <pre><code>class c:
      aNumber = 0
      def __add__(self, operand):
          print(&quot;words&quot;)
          return self.aNumber + operand.aNumber
  
  a = c()
  b = c()
  a.aNumber += 1
  b.aNumber += 2
  print(a + b) # prints &quot;words\n3&quot;
  </code></pre>
  <p>I thought that maybe the operator methods are really overridden in python since we overload <a href="https://stackoverflow.com/questions/7113032/overloaded-functions-in-python">using optional parameters</a> and we just call it operator overloading out of convention.</p>
  <p>But it also couldn't be an override, since <code>'__add__' in object.__dict__.keys()</code> is <code>False</code>; a method needs to be a member of the parent class in order to be overridden (and all classes inherit from <code>object</code> when created).</p>
  <p>Where is the gap in my understanding?</p>