make class iterable
How do I make a class iterable?
I want to create a class, which is a set of objects that I created, that has attributes of its own.
The user experience I am thinking of is the following:
(let's say A, B, and C are Objects in memory)
sage: D = Box((A,B,C))
I want to be able to say for i in D: ....
But I can't.
Any tips?