New submission from Raymond Hettinger: Replace all the _sqrt(x) calls with x ** 0.5, improving the visual appearance and providing a modest speed improvement.
$ python3 -m timeit -s 'from math import sqrt' 'sqrt(3.14)' 10000000 loops, best of 3: 0.032 usec per loop $ python3 -m timeit -s 'from math import sqrt' '3.14 ** 0.5' 100000000 loops, best of 3: 0.0101 usec per loop ---------- components: Library (Lib) files: random_sqrt.diff keywords: patch messages: 242017 nosy: rhettinger priority: low severity: normal stage: patch review status: open title: Minor speed and readability improvement to the random module type: performance versions: Python 3.5 Added file: http://bugs.python.org/file39206/random_sqrt.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24059> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com