[Python-Dev] Iterator addition?

Sami Hangaslammi shang@cc.jyu.fi
Mon, 30 Jul 2001 09:56:09 +0300 (EET DST)


Since iterator objects work like sequences in several contexts, maybe they
could support sequence-like operations such as addition. This would let
you write

  for x in iter1 + iter2:
      do_something(x)

instead of

  for x in iter1:
      do_something(x)

  for x in iter2:
      do_something(x)

or the slightly better

  for i in iter1,iter2:
      for x in i:
          do_something(x)


-- Sami Hangaslammi --