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 ciphergoth
Recipients ciphergoth, mark.dickinson, rhettinger
Date 2018-10-28.22:15:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1540764938.53.0.788709270274.issue35094@psf.upfronthosting.co.za>
In-reply-to
Content
Thank you for a very comprehensive and helpful answer!

Yep, reservoir sampling makes n calls not k calls, and so should only be used when k is a large fraction of n; in my patch it's k/n >= 1/2.

Because modern CPRNGs are so fast, I had been assuming that overall runtime, rather than calls to the RNG; I'll have to bear that in mind here, though in general "use a secure seed to whatever secure RNG is fastest" is the right strategy.

I don't think hedging against the quality of the RNG is the right thing to do here.

I don't mean to suggest you didn't think about this problem hard! It's just that I've been obsessing about this problem for the last few weeks for some reason (see my repo) so I thought I might be able to help. Thanks again for you reply!
History
Date User Action Args
2018-10-28 22:15:38ciphergothsetrecipients: + ciphergoth, rhettinger, mark.dickinson
2018-10-28 22:15:38ciphergothsetmessageid: <1540764938.53.0.788709270274.issue35094@psf.upfronthosting.co.za>
2018-10-28 22:15:38ciphergothlinkissue35094 messages
2018-10-28 22:15:38ciphergothcreate