A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2003-January/032587.html below:

[Python-Dev] map, filter, reduce, lambda

[Python-Dev] map, filter, reduce, lambdaAndrew Koenig ark@research.att.com
Thu, 30 Jan 2003 18:04:30 -0500 (EST)
Guido> I'll have to think about this more.  lambda is annoying to me
Guido> because it adds so little compared to writing a one-line def.
Guido> But it makes sense for certain programming styles.

Yes -- there are times when notational compactness greatly aids mental
chunking.  And of course there are other times when notational
compactness stands in the way of comprehension.

Sometimes a single notation can do both at once, depending on the
reader's prior experience.  Consider the following C statement:

	 *p++ = *q++;

If you're an experienced programmer, the meaning of this statement
is immediately obvious; if not, it's obfuscation.

Similarly,

	 map(lambda x: x**2, data)

is really obvious to some people, and confusing to others, as is

	 [x**2 for x in data]

-- 
Andrew Koenig, ark@research.att.com, http://www.research.att.com/info/ark



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