[Python-ideas] Intermediate Summary: Fast sum() for non-numbers

Joshua Landau joshua at landau.ws
Thu Jul 18 18:00:07 CEST 2013


On 18 July 2013 16:48, Stefan Behnel <stefan_ml at behnel.de> wrote:
> The point I was trying to make is that a "sum" is well defined for numbers
> but not for lists,

False.

> so even a recursive sum over lists of lists makes more
> sense than calling sum() on a sequence of lists and expecting it to
> concatenate those lists.

I disagree.

> I really don't see the link between summing up
> items and concatenating them. If the function was called "concatenate()",
> then, yes, ok, I'd expect it to concatenate lists that I feed into it. But
> it's called sum(). And it's called that because the name describes what it
> does. The mere attempt to "sum" lists is just so misguided that it's really
> not worth any discussion, especially not about making it easier!

You're discussing it, and it isn't misguided.


More information about the Python-ideas mailing list