This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients Serge Anuchin, mark.dickinson, pitrou, r.david.murray, rhettinger, serhiy.storchaka, skrah, steven.daprano, tim.peters, vstinner
Date 2015-07-10.00:25:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1436487905.74.0.440459605192.issue24567@psf.upfronthosting.co.za>
In-reply-to
Content
Victor, don't ask me, look at the code:  the random.choice() implementations in Python 2 and Python 3 have approximately nothing in common, and "the bug" here should already be impossible in Python 3 (but I can't check that, because I don't have a platform that does double-rounding).  I already pointed out (in my 2015-07-05 15:42 note) that Python 3 uses "only integers" in most cases.

"It's easy to replace int(i * random.random()) with randint(0, i)".  You didn't say that was your _intent_, and I didn't guess it.  In that case you also have to weigh in the considerable extra expense of adding another Python-level function call.  The speed of these things is important, and it's annoying enough just to add the expense of calling the C-level `min()`.
History
Date User Action Args
2015-07-10 00:25:05tim.peterssetrecipients: + tim.peters, rhettinger, mark.dickinson, pitrou, vstinner, steven.daprano, r.david.murray, skrah, serhiy.storchaka, Serge Anuchin
2015-07-10 00:25:05tim.peterssetmessageid: <1436487905.74.0.440459605192.issue24567@psf.upfronthosting.co.za>
2015-07-10 00:25:05tim.peterslinkissue24567 messages
2015-07-10 00:25:04tim.peterscreate