title: What is the purpose of checking self.__class__?
body: <p>What is the purpose of checking <code>self.__class__</code> ? I've found some code that creates an abstract interface class and then checks whether its <code>self.__class__</code> is itself, e.g.</p>
  
  <pre><code>class abstract1 (object):
    def __init__(self):
      if self.__class__ == abstract1: 
        raise NotImplementedError("Interfaces can't be instantiated")
  </code></pre>
  
  <p><strong>What is the purpose of that?
  Is it to check whether the class is a type of itself?</strong></p>
  
  <p>The code is from NLTK's <a href="http://nltk.googlecode.com/svn/trunk/doc/api/nltk.probability-pysrc.html#ProbDistI" rel="noreferrer">http://nltk.googlecode.com/svn/trunk/doc/api/nltk.probability-pysrc.html#ProbDistI</a></p>