[issue33144] random._randbelow optimization

Wolfgang Maier report at bugs.python.org
Wed Mar 28 11:01:18 EDT 2018


Wolfgang Maier <wolfgang.maier at biologie.uni-freiburg.de> added the comment:

In addition, I took the opportunity to fix a bug in the original _randbelow in that it would only raise the advertised ValueError on n=0 in the getrandbits-dependent branch, but ZeroDivisionError in the pure random branch.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33144>
_______________________________________


More information about the Python-bugs-list mailing list