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-August/037638.html below:

[Python-Dev] map(None, ...) in tutorial

[Python-Dev] map(None, ...) in tutorialGuido van Rossum guido at python.org
Thu Aug 14 16:03:12 EDT 2003
> I've noticed this section in the tutorial:
> 
>     [...], we see that map(None, list1, list2) is a convenient way of
>     turning a pair of lists into a list of pairs.  For example:
> 
>     >>> map(None, seq, map(square, seq))
>     [(0, 0), (1, 1), (2, 4), (3, 9), (4, 16), (5, 25), (6, 36), (7, 49)]
> 
> I think the example be changed to use zip() instead, ie:
> 
>     >>> zip(seq, map(square, seq))
>     [(0, 0), (1, 1), (2, 4), (3, 9), (4, 16), (5, 25), (6, 36), (7, 49)]
> 
> Any objections?

But then it's no longer an example of the usefulness of map(None, x, y)?

(Well, map(None, ...) is never useful, so maybe that's okay...)

--Guido van Rossum (home page: http://www.python.org/~guido/)

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