Not too sure but I suppose you can design class iterators and you decide how
they behave.
I normally just add a __iter__ method and use yield
class IteratorObject:
def __init__(self, data):
self.data = data
self.__items = len(data)
def __iter__(self):
index = 0
while index < self.__items:
result = blah blah i.e do what ever you want here
#eg return a random item from list
yield result
index += 1
not sure if this helps
"Manlio Perillo" <NO******************@libero.it> wrote in message
news:o9********************************@4ax.com...
Hi.
Python support forward iterators, but what about bidirectional and
random access ones?
Regards Manlio Perillo