I would love to be able to do
>>> A = numpy.array(((1,2),(3,4)))
>>> idx = (0,0)
>>> A[*idx]
and get
<
Indexing an object calls:
object.__getitem__(index)
When you do A[1, 2], it's the equivalent of:
A.__getitem__((1, 2))
So when you do:
b = (1, 2)
A[1, 2] == A[b]
A[1, 2] == A[(1, 2)]
Both statements will evaluate to True.
If you happen to index with a list, it might not index the same, as [1, 2] != (1, 2)