➜

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.

作者 pitrou
收信人 amaury.forgeotdarc, nadeem.vawda, pitrou, rhettinger
日期 2011-11-13.20:41:34
SpamBayes Score 2.6156854e-13
Marked as misclassified 否
Message-id <1321216608.3282.2.camel@localhost.localdomain>
In-reply-to <1321213804.4.0.114738908598.issue13396@psf.upfronthosting.co.za>
内容
> The problem is that we need an API that will accommodate other random
> number generators and not be specific to the MersenneTwister.  Right
> now, the starting point for everything in the random module is an
> underlying generator supplying a random() method returning a float and
> an optional getrandombits() method which returns an int (possibly a
> long int).

Well, you can provide a default getrandombytes() which calls into
getrandombits(), and specialize it in the case genrand_int32() exists.

>   The latter is easily convertible to bytes with to_bytes() which uses
> a fast O(n) algorithm.

Well, O(n) doesn't necessarily equate fast. Can Amaury post benchmark
numbers of getrandbits().to_bytes() vs getrandbytes()?
历史
日期 用户 动作 参数
2011-11-13 20:41:35pitrou修改recipients: + pitrou, rhettinger, amaury.forgeotdarc, nadeem.vawda
2011-11-13 20:41:34pitrou链接issue13396 messages
2011-11-13 20:41:34pitrou创建