title: issubclass of abstract base class Sequence
body: <p><a href="https://docs.python.org/2/library/collections.html#collections-abstract-base-classes" rel="noreferrer">This list</a> shows what methods you need to implement for your class to be "regarded" as Sequence: <code>__getitem__</code>, <code>__len__</code>, <code>__contains__</code>, <code>__iter__</code>, <code>__reversed__</code>, <code>index</code>, and <code>count</code>. So why does this minimal implementation does not work, i.e. why <code>issubclass(S, Sequence) is False</code>?</p>
  
  <pre><code>from collections import *
  
  
  class S(object):
      def __getitem__(self, item):
          raise IndexError
  
      def __len__(self):
          return 0
  
      def __contains__(self, item):
          return False
  
      def __iter__(self):
          return iter(())
  
      def __reversed__(self):
          return self
  
      def index(self, item):
          raise IndexError
  
      def count(self, item):
          return 0
  
  
  issubclass(S, Iterable)   # True  :-)
  issubclass(S, Sized)      # True  :-)
  issubclass(S, Container)  # True  :-)
  issubclass(S, Sequence)   # False :-(
  </code></pre>
  
  <p>Is there an additional method I need to implement that I overlooked? Did I misunderstand abstract base classes? Subclassing <code>Sequence</code> makes <code>issubclass</code> return <code>True</code> of course, but that kinda defeats the idea behind abc, doesn't it?</p>