[Raymond, recently]: > The product() accumulator is the one destined to be a builtin. > > Though it is not nearly as common as sum(), it does enjoy > some popularity. Having it available will help dispense > with reduce(operator.mul, data, 1). > > Would there be any objections to my adding product() to > Py2.4? The patch was simple and it is ready to go unless > someone has some major issue with it. Just wanted to bring you a blast from the past: [http://mail.python.org/pipermail/python-dev/2003-April/034784.html] [Alex Martelli:] > I think I understand the worry that introducing 'sum' would be the start > of a slippery slope leading to requests for 'prod' (I can't think of other > bulk operations that would be at all popular -- perhaps bulk and/or, but > I think that's stretching it). But I think it's a misplaced worry in this > case. "Adding up a bunch of numbers" is just SO much more common > than "Multiplying them up" (indeed the latter's hardly idiomatic English, > while "adding up" sure is), that I believe normal users (as opposed to > advanced programmers with a keenness on generalization) wouldn't > have any problem at all with 'sum' being there and 'prod' missing... I have nothing to add... Alex said it much better than I could. -- Michael Chermside
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4