[EMAIL PROTECTED] wrote: > Try it with > > def test(): > L = 'a', 1, 2, 'a' > it1, it2 = xsplitter(L, lambda x: x == 'a') > print it1.next() > print it2.next() > print it1.next() > print it2.next() > > > The last print statement raises StopIteration... > We, however, expected each iterator to contain > two elements (one yielding 'a' then 'a', and > the other yielding 1 then 2).
Ouch! I never understood much about generators anyway. A. -- http://mail.python.org/mailman/listinfo/python-list