A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-July/016379.html below:

[Python-Dev] Iterator addition?

[Python-Dev] Iterator addition?Sami Hangaslammi shang@cc.jyu.fi
Mon, 30 Jul 2001 12:20:54 +0300 (EET DST)
Just van Rossum wrote:

> from __future__ import generators
> 
> def concat(*iterators):
>     for i in iterators:
>         for x in i:
>             yield x
> 
> for x in concat(iter1, iter2):
>     do_something(x)

Yes, this is the solution that I eventually ended up with too. However,
the real point I was trying to raise was, wether interators should look
like sequences regarding addition, since the two are already exchangeable
in so many places (e.g. tuple unpacking).


Moshe Zadka wrote:

> Wasn't there talk about having an iterator module with useful stuff
> like that?

This would be a great idea. I've ended up with a sizeable bunch of small
utility functions when playing around with generators/iterators in 2.2a1.

-- Sami Hangaslammi --




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4