My class implements an iterator so I can do:
for i in class():
But I want to be able to access the class by index as well:
class()[1]
How can I do that?
Implement both __iter__() and __getitem__() et alia methods.
__iter__()
__getitem__()