title: Is there a way to implement methods like __len__ or __eq__ as classmethods?
body: <p>It is pretty easy to implement <code>__len__(self)</code> method in Python so that it handles <code>len(inst)</code> calls like this one:</p>
  
  <pre><code>class A(object):
  
    def __len__(self):
      return 7
  
  a = A()
  len(a) # gives us 7
  </code></pre>
  
  <p>And there are plenty of alike methods you can define (<code>__eq__</code>, <code>__str__</code>, <code>__repr__</code> etc.).
  I know that Python classes are objects as well. </p>
  
  <p>My question: can I somehow define, for example, <code>__len__</code> so that the following works:</p>
  
  <pre><code>len(A) # makes sense and gives some predictable result
  </code></pre>