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

Andrew Barnert abarnert at yahoo.com
Thu Jul 4 00:22:44 CEST 2013


On Jul 3, 2013, at 15:02, Joshua Landau <joshua.landau.ws at gmail.com> wrote:

> Also, if you're summing linked lists, why would it be O(n**2)
> performance? Surely it's still O(n), given the new implementation?

Not for single-linked lists, where extend is O(n).

(Of course maybe this is a good thing--it's a perfect opportunity for someone to show whoever wrote that code how to actually write his algorithm in python rather than trying to use python as lisp without even knowing lisp...)


More information about the Python-ideas mailing list