I'd like to be able to access some values of a python object using array-like syntax, ie:
obj = MyClass()
zeroth = obj[0]
first = obj[1]
Is this possible? If so, how do you implement this in the python class in question?
See Question&Answers more detail:os