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 <1530051472.62.0.56676864532.issue24567@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
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: <1530051472.62.0.56676864532.issue24567@psf.upfronthosting.co.za>
2018-06-26 22:17:52tim.peterslinkissue24567 messages
2018-06-26 22:17:52tim.peterscreate