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

Mathias Panzenböck grosser.meister.morti at gmx.net
Sat Jul 6 22:17:42 CEST 2013


Maybe what you actually want would be list.extend to accept *args?

 >>> l = []
 >>> l.extend(*([[1,2,3]]*1000000))

Or something similar.

I think "sum" is about mathematical sums. This would be list concatenation and not building sums.
After all, what does addition in the context of lists even mean? In the context of sets it might
be meaningful, but for lists?


More information about the Python-ideas mailing list