Concatenating iterators

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Wed Aug 29 07:26:45 EDT 2001


Wed, 29 Aug 2001 01:45:18 +0200, Magnus Lie Hetland <mlh at idi.ntnu.no> pisze:

> Is there a standard way of concatenating iterators yet?

I'm afraid it can't be done simpler than by making a function like this:

def concat(*its):
    for it in its:
        for x in it: yield x

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list