Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:
I tested few cases (all positive, all negative, mixed), and did not found any performance difference after this change. ./python -m perf timeit -s "a = list(range(10**4))" -- "sum(a)" ./python -m perf timeit -s "a = [-i for i in range(10**4)]" -- "sum(a)" ./python -m perf timeit -s "a = [i*(-1)**i for i in range(10**4)]" -- "sum(a)" ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue36791> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com