[New-bugs-announce] [issue7402] reduce() is an anti-example in "Idioms and Anti-Idioms"

Christoph Zwerschke report at bugs.python.org
Fri Nov 27 11:47:22 CET 2009


New submission from Christoph Zwerschke <cito at online.de>:

In the section "Using the batteries" of the "Idioms and Anti-Idioms in
Python" document
(http://docs.python.org/dev/howto/doanddont.html#using-the-batteries),
the reduce statement is used for summing up numbers as an example. I
think this is rather an anti-example, because Python already has a sum
function built-in, i.e. reduce(operator.add, nums)/len(nums) can be
written much simpler as sum(nums)/len(nums).

----------
assignee: georg.brandl
components: Documentation
messages: 95762
nosy: cito, georg.brandl
severity: normal
status: open
title: reduce() is an anti-example in "Idioms and Anti-Idioms"
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1, Python 3.2

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


More information about the New-bugs-announce mailing list