Pythonic way to sum n-th list element?

Roy Smith roy at
Tue Apr 22 14:48:34 CEST 2003

Alex Martelli <aleax at> wrote:
> You're welcome, but for "sum([]) returns 0" you should thank Guido
> and Tim (it would raise a ValueError if I had implemented it my way;-).

It's hard to imagine that anybody who would put complex number support 
in the core of the language, and use the One True Symbol for the 
imaginary unit would think sum([]) should be anything but zero.  I'm 
with Guido j^2 on this one.

More information about the Python-list mailing list