Tim Peters added the comment:

Victor, if people want to use getrandbits(), we should backport the Python3 
code, not reinvent it from scratch.

Note too Mark's comment:  "There are several places in the source where 
something of the form `int(i * random.random())` is used".  The `min()` trick 
is relatively easy to apply via simple, local editing of such places.  

Your "It doesn't handle negative numbers nor empty ranges" should be a hint 
about what a pain it is to rewrite everything wholesale to use a 
_fundamentally_ different method.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24567>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to