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/2007-September/074783.html below:

[Python-Dev] Adding concat function to itertools

[Python-Dev] Adding concat function to itertools [Python-Dev] Adding concat function to itertoolsMike Klaas mike.klaas at gmail.com
Fri Sep 28 23:40:08 CEST 2007
On 28-Sep-07, at 10:45 AM, Raymond Hettinger wrote:

> [Bruce Frederiksen]
>>>  I've added a new function to itertools called 'concat'.  This  
>>> function is
>>> much like chain, but takes all of the iterables as a single  
>>> argument.
>
> Any practical use cases or is this just a theoretical improvement?
>
> For Py2.x, I'm not willing to unnecessarily expand the module.
> However, for Py3k, I'm open to changing the signature for chain().

For me, a fraction of chain() uses are of the * variety:

d = defaultdict(list)
allvals = chain(*d.values())

return chain(*imap(cache.__getitem__, keylist))

Interestingly, they seem to all have something to do with dictionary  
values() that are themselves iterable.

-Mike


More information about the Python-Dev mailing list

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