On Tue, 29 Aug 2006 22:41:37 +0300, John Doe <[EMAIL PROTECTED]> wrote: >This is sort of a feature request/idea: Chaining generators. > >If you have two lists (or tuples) and you add them, the result is a >concatenation of the two. >I think it would be nice if it was possible to do something similar with >generators. The best way to explain is by code example: > >def add_generators(gen1, gen2): > for x in gen1: > yield x > for y in gen2: > yield y > >Just a thought...
You can chain any iterators using itertools.chain(). Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list