[Python-ideas] + operator on generators

Brendan Barnwell brenbarn at brenbarn.net
Tue Jun 27 17:05:40 EDT 2017


On 2017-06-27 14:02, David Mertz wrote:
> On Tue, Jun 27, 2017 at 1:57 PM, Mike Miller <python-ideas at mgmiller.net
> <mailto:python-ideas at mgmiller.net>> wrote:
>
>     I like this suggestion.  Here's another color that might be less
>     controversial:
>
>          iterable3 = iterable1.chain(iterable2)
>
>
> How do you chain it1, it2, it3, etc?
>
> I guess `it1.chain(it2.chain(it3)))` ... but that starts to become
> distinctly less readable IMO.  I'd much rather spell `chain(it1, it2, it3)`.

	Even if this "chain" only took one argument, you could do 
it1.chain(it2).chain(it3).  But I don't see why it couldn't take 
multiple arguments as you suggest.

-- 
Brendan Barnwell
"Do not follow where the path may lead.  Go, instead, where there is no 
path, and leave a trail."
    --author unknown


More information about the Python-ideas mailing list