Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

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

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Nov 27, 2009, 2:47 AM

Post #1 of 2 (195 views)
Permalink
[issue7402] reduce() is an anti-example in "Idioms and Anti-Idioms"

New submission from Christoph Zwerschke <cito [at] online>:

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>
<http://bugs.python.org/issue7402>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 27, 2009, 12:08 PM

Post #2 of 2 (170 views)
Permalink
[issue7402] reduce() is an anti-example in "Idioms and Anti-Idioms" [In reply to]

Changes by Raymond Hettinger <rhettinger [at] users>:


----------
assignee: georg.brandl -> rhettinger
nosy: +rhettinger

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7402>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.