Éric Araujo <mer...@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 <rep...@bugs.python.org> <http://bugs.python.org/issue7402> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com