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/2000-April/003724.html below:

[Python-Dev] map() methods (was: Re: [Patches] Review (was: Please review before applying))

[Python-Dev] map() methods (was: Re: [Patches] Review (was: Please review before applying)) [Python-Dev] map() methods (was: Re: [Patches] Review (was: Please review before applying))Tim Peters tim_one@email.msn.com
Mon, 24 Apr 2000 20:56:18 -0400
[Guido]
> ...
> However, this is *still* not as powerful as
>
>   map(lambda s: s.strip(), L)
>
> because the former requires that all items in L are in fact strings,
> while the latter works for anything with a strip() method (in
> particular Unicode objects and UserString instances).
>
> Maybe Python 3000 should recognize map(lambda) and generate more
> efficient code for it...

    [s.strip() for s in L]

That is, list comprehensions solved the speed, generality and clarity
problems here before they were discovered <wink>.





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