New submission from Uri Elias <uri.u...@gmail.com>: True at least to PY2.7 and 3.5 - given x is a numpy array, say np.random.rand(int(1e6)), then sum(x) is much slower (for 1e6 elements - 2 orders of magnitude) than x.sum(). Now, while this is understandable behaviour, I wander how hard it is to add a condition that if argument is a Numpy object then use its own sum. I think many programmers aren't aware of that, so all in all it can improve the performance of a lot of existing code.
---------- components: 2to3 (2.x to 3.x conversion tool) messages: 312495 nosy: urielias priority: normal severity: normal status: open title: Make general function sum() use Numpy's sum when obviously possible type: enhancement versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32895> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com