title: Require inheritance in Python?
body: <p>What's the safest approach to going about requiring inheritance? Currently I'm doing something similar to this:</p>
  
  <pre><code>&gt;&gt;&gt; class A:  # Never instantiate by itself.
  ...     def a(self):
  ...         self.foo()
  ... 
  ... class B(A):
  ...     def foo(self):
  ...         print('123')
  ... 
  ... class C(A):
  ...     def foo(self):
  ...         print('456')
  ...         
  &gt;&gt;&gt; B().a()
  123
  C().a()
  456
  &gt;&gt;&gt; A().a()  # Expect an error.
  Traceback (most recent call last):
    File "&lt;input&gt;", line 1, in &lt;module&gt;
    File "&lt;input&gt;", line 3, in a
  AttributeError: 'A' object has no attribute 'foo'
  </code></pre>
  
  <p>Is this the best approach?</p>