Author tim.peters
Recipients Serge Anuchin, mark.dickinson, pitrou, r.david.murray, rhettinger, serhiy.storchaka, skrah, steven.daprano, tim.peters, vstinner
Date 2018-06-26.22:17:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Victor, look at Raymond's patch.  In Python 3, `randrange()` and friends already use the all-integer `getrandbits()`.  He's changing three other lines, where some variant of `int(random() * someinteger)` is being used in an inner loop for speed.

Presumably the

            return int(random() * n)

line in the `n >= maxsize` branch of `_randbelow_without_getrandbits()` should also get clamped.
Date User Action Args
2018-06-26 22:17:52tim.peterssetrecipients: + tim.peters, rhettinger, mark.dickinson, pitrou, vstinner, steven.daprano, r.david.murray, skrah, serhiy.storchaka, Serge Anuchin
2018-06-26 22:17:52tim.peterssetmessageid: <>
2018-06-26 22:17:52tim.peterslinkissue24567 messages
2018-06-26 22:17:52tim.peterscreate