On 18 Feb, 23:33, Ben Finney <ben+pyt...@benfinney.id.au> wrote: [...] > No need to define functions or classes; let a generator expression take > care of it for you:: > > >>> foo = (x for x in list()) > >>> foo.next() > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > StopIteration
What about foo = iter('') Then there is the interesting foo = iter(int, 0) :) -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list