Check for [] operator
<p>How do I check whether an object supports [] operation in Python? I think of something like the following:</p>

<pre><code>if supports(obj, ?[]?):
    print("Supports")  
</code></pre>
