[Python-Dev] Fwd: summing a bunch of numbers (or "whatevers")

Uche Ogbuji uche.ogbuji@fourthought.com
Sat, 19 Apr 2003 21:51:38 -0600

> Now, I think the obvious approach would be to have a function sum,
> callable with any non-empty homogeneous sequence (sequence of
> items such that + can apply between them), returning the sequence's
> summation -- now THAT might help for simplicity, clarity AND power.

+1.  I agree that this is a natural additon to min() and max(), and a common 
enough case to clarify and optimize.

> I'm not
> quite sure where it should go -- a builtin seems most natural (to keep
> company with min and max, for example), but maybe that would be
> too ambitious, and it should be in math or operator instead...

+1 on builtins, but I'd be OK with math or op as well.

Uche Ogbuji                                    Fourthought, Inc.
http://uche.ogbuji.net    http://4Suite.org    http://fourthought.com
Gems From the [Python/XML] Archives - http://www.xml.com/pub/a/2003/04/09/py-xm