title: Advantages of Using MethodType in Python
body: <p>What are the advantages of using <code>MethodType</code> from the <code>types</code> module? You can use it to add methods to an object. But we can do that easily without it:</p>
  
  <pre><code>def func():
     print 1
  
  class A:
     pass
  
  obj = A()
  obj.func = func
  </code></pre>
  
  <p>It works even if we delete <code>func</code> in the main scope by running <code>del func</code>.</p>
  
  <p>Why would one want to use <code>MethodType</code>? Is it just a convention or a good programming habit?</p>