title: python @abstractmethod decorator
body: <p>I have read python docs about abstract base classes:</p>
  
  <p>From <a href="http://docs.python.org/library/abc.html" rel="noreferrer">here</a>:</p>
  
  <blockquote>
    <p><code>abc.abstractmethod(function)</code>
    A decorator indicating abstract methods.</p>
    
    <p>Using this decorator requires that the class’s metaclass is <code>ABCMeta</code> or
    is derived from it. A class that has a metaclass derived from <code>ABCMeta</code>
    cannot be instantiated unless all of its abstract methods and
    properties are overridden.</p>
  </blockquote>
  
  <p>And <a href="http://docs.python.org/whatsnew/2.6.html#pep-3119-abstract-base-classes" rel="noreferrer">here</a></p>
  
  <blockquote>
    <p>You can apply the <code>@abstractmethod</code> decorator to methods such as draw()
    that must be implemented; Python will then raise an exception for
    classes that don’t define the method. Note that the exception is only
    raised when you actually try to create an instance of a subclass
    lacking the method.</p>
  </blockquote>
  
  <p>I've used this code to test that out:</p>
  
  <pre class="lang-py prettyprint-override"><code>import abc
  
  class AbstractClass(object):
    __metaclass__ = abc.ABCMeta
  
    @abc.abstractmethod
    def abstractMethod(self):
      return
  
  class ConcreteClass(AbstractClass):
    def __init__(self):
      self.me = "me"
  
  c = ConcreteClass()
  c.abstractMethod()
  </code></pre>
  
  <p>The code goes fine, so I don't get it. If I type <code>c.abstractMethod</code> I get:</p>
  
  <pre><code>&lt;bound method ConcreteClass.abstractMethod of &lt;__main__.ConcreteClass object at 0x7f694da1c3d0&gt;&gt;
  </code></pre>
  
  <p>What I'm missing here? <code>ConcreteClass</code> <em>must</em> implement the abstract methods, but I get no exception.</p>