3 ms·
You're actually wrong about Python's sum function, it works for anything you can + on BUT strings [0], this is to avoid quadratic behavior with string concatena
by Franciscouzo 9y ago
You're actually wrong about Python's sum function, it works for anything you can + on BUT strings [0], this is to avoid quadratic behavior with string concatenation.
[0] https://github.com/python/cpython/blob/5837d0418f47933b2e3c139bdee8a79c248a943c/Python/bltinmodule.c#L2230 https://github.com/python/cpython/blob/5837d0418f47933b2e3c1...