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/2003-February/033524.html below:

[Python-Dev] [rfc] map enhancement

[Python-Dev] [rfc] map enhancement [Python-Dev] [rfc] map enhancementRaymond Hettinger python@rcn.com
Wed, 19 Feb 2003 11:15:19 -0500
> Your solution for itertools can work with map too:
> 
> def repeat(v,n):
>     while n:
>        yield v
>        n-=1
> 
> map(f,L,repeat(K,len(L))) 

The itertools combine together so you can do it all 
at C speed and not have to create your own ad-hoc
generator:

from itertools import repeat, islice
map(f, L, islice(repeat(K),len(L)))


Raymond Hettinger



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