Python data type for multi-indices
I have started to port (some of) the C++ tests to Python. Doing that I noticed that multi-indices are Python objects of type list
. As a consequence multi-indices are not hashable; in particular they cannot be used as keys in a dictionary.
This got me wondering whether multi-indices should be represented by something else. The first idea would be to use tuples
. The difference to lists is that tuples are immutable. This sounds like a reasonable restriction for many uses, but there are certainly exceptions.
Opinions?