[Python-3000] Python 3000 Status Update (Long!)

Jim Jewett jimjjewett at gmail.com
Tue Jun 19 17:29:30 CEST 2007


On 6/19/07, Gábor Farkas <gabor at nekomancer.net> wrote:
> Guido van Rossum wrote:
> > I've written up a comprehensive status report on Python 3000. Please read:

> > http://www.artima.com/weblogs/viewpost.jsp?thread=208549

> why does map and filter stay, but reduce leaves?

> i understand that some people think that an explicit for-loop is more
> understandable, but also many people claim that list-comprehensions are
> more understandable than map/filter.., and map/filter can be trivially
> written using list-comprehensions.. so why  _reduce_?

Note:  these are my opinions, which may be unrelated to Guido's reasoning.

In practice, reduce is almost always difficult to read and understand.
 There are counterexamples, but they tend to already be written
without reduce.  (They may use sum instead of a for loop, but they
don't use reduce, unless they are intended as an example of reduce
usage.)

filter is at least well-named; no one has any doubts over what it is doing.

map over a simple function is better written as a list comprehension,
but if the function is complicated, has side effects, sends output to
multiple places ... then map is probably a less-bad choice.

-jJ


More information about the Python-3000 mailing list