list's index() method for nested structures OR how to match against particular value of composed element stored in list and get it's index <p>It is possible to get index of particular element in list using <code>index()</code> method, following way (borrowed from <a href="http://stackoverflow.com/questions/176918/finding-the-index-of-an-item-given-a-list-containing-it-in-python">here</a>):</p> <pre><code>&gt;&gt;&gt; ["foo", "bar", "baz"].index('bar') 1 </code></pre> <p>Is it possible to apply the same principle to nested structures (if not what is the closest most pythonic way)? The result should looks like this:</p> <pre><code>In [20]: list Out[20]: [(0, 1, 2), (3, 4, 5)] In [21]: list.someMagicFunctionHere(,4,) Out[20]: 1 </code></pre>