On 6/19/07, Gábor Farkas <[EMAIL PROTECTED]> 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
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to