Why collections.Callable provides __contains__(), __hash__(), __len__() and __call__()
<p>Why does the <a href="https://docs.python.org/2.7/library/collections.html?#collections.Callable" rel="nofollow">documentation</a> says:</p>

<blockquote>
  <p>class collections.Callable</p>
  
  <p>ABCs for classes that provide respectively the methods <strong>contains</strong>(), <strong>hash</strong>(), <strong>len</strong>(), and <strong>call</strong>().</p>
</blockquote>

<p>And not only <code>__call__()</code> ?</p>

<p>What is the role of <code>__contains__()</code>, <code>__hash__()</code>, <code>__len__()</code> for callable object?</p>

<p>For instance, do I need to make my classes hashable?</p>

<p>You misunderstand what that text says. The documentation covers <strong>four</strong> ABCs:</p>

<pre><code>class collections.Container
class collections.Hashable
class collections.Sized
class collections.Callable
</code></pre>

<p>The <a href="http://english.stackexchange.com/questions/24525/what-does-the-word-respectively-mean-in-software-development">grammar construct <em>respectively</em></a> in the sentence <em>ABCs for classes that provide respectively the methods</em> attaches a separate method to each of the  four classes here, in order.</p>

<p>So <code>Container</code> provides <code>__contains__()</code>, <code>Hashable</code> covers <code>__hash__()</code>, <code>Sized</code> covers <code>__len__()</code> and <code>Callable</code> covers <code>__call__()</code>.</p>

<p>In other words, <code>Callable</code> only provides a <code>__call__()</code> method, not any of the other 3 methods.</p>

python callable