[issue7402] Imrpove reduce example in doanddont.rst

Éric Araujo report at bugs.python.org
Wed Sep 8 03:57:12 CEST 2010


Éric Araujo <merwok at netwok.org> added the comment:

I agree with Raymond that the example should be kept. We could add a comment explaining the difference with sum: reduce + operator.add works with all types. (sum would be marked up so that a link gets generated.)

Is there a subsection about functional programming yet? reduce, filter and map are not always easy to use, especially now that they are lazy and thus can’t be used as a poor man’s for loop (i.e. for side effects, no to build a list). Such a section would be short and link to the functional programming howto.

In the long term, integrating David Goodger’s document into the main docs so that it gets more exposure and more updates seems very useful to me.

----------
title: reduce() is an anti-example in "Idioms and Anti-Idioms" -> Imrpove reduce example in doanddont.rst
versions:  -Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7402>
_______________________________________


More information about the Python-bugs-list mailing list