[issue24059] Minor speed and readability improvement to the random module

Mark Dickinson report at bugs.python.org
Sun Apr 26 19:26:38 CEST 2015


Mark Dickinson added the comment:

Gah!  Peephole optimizer!  When you do a timeit for '3.14 ** 0.5', you're just evaluating the time to retrieve a constant!

In general, `**` is going to be both slower *and* less accurate than math.sqrt.  Please don't make this change!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24059>
_______________________________________


More information about the Python-bugs-list mailing list