Communities for your favorite technologies. Explore all Collectives
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Might be a n00b question, but I currently have aMy class that implements an iterator so I can do something like:
for i in class():
butBut I want to be able to access the class by index as well like:
class()[1]
How can I do that?
Thanks!
Might be a n00b question, but I currently have a class that implements an iterator so I can do something like
but I want to be able to access the class by index as well like
My class implements an iterator so I can do:
But I want to be able to access the class by index as well: