title: How can I override magic methods?
body: <p>Today, I was reading a book about python and I got to know that there are some magic methods such as <code>__add__</code> and <code>__mul__</code>.</p>
  
  <p>But, in the book, there is no explanation on how to use them.</p>
  
  <p>So, I tried to figure it out by myself. But, I couldn't figure out how to override magic methods.
  Here is the code I tried.</p>
  
  <pre><code>&gt;&gt;&gt; class Num(int):
  ...     def __init__(self, number):
  ...             self.number = number
  ...     def __add__(self, other):
  ...             self.number += other*100
  ...             return self.number
  ... 
  &gt;&gt;&gt; num = Num(10)
  &gt;&gt;&gt; num.number + 10
  20
  </code></pre>
  
  <p>Could anyone please help me understand how these magic methods work?</p>