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 rhettinger
Recipients amaury.forgeotdarc, nadeem.vawda, pitrou, rhettinger
Date 2011-11-13.19:50:03
SpamBayes Score 1.4410734e-10
Marked as misclassified No
Message-id <1321213804.4.0.114738908598.issue13396@psf.upfronthosting.co.za>
In-reply-to
Content
> genrand_int32 is an internal function, 
> only available in C for the Mersenne Twister generator.

Yes, I know.  I'm the one added that code ;-)

>  I don't know other generators.

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).  The latter is easily convertible to bytes with to_bytes() which uses a fast O(n) algorithm. ISTM, the getrandbytes() proposal amounts to a micro-optimization of existing capabilities, and it comes at the expense of fattening the API.
History
Date User Action Args
2011-11-13 19:50:04rhettingersetrecipients: + rhettinger, amaury.forgeotdarc, pitrou, nadeem.vawda
2011-11-13 19:50:04rhettingersetmessageid: <1321213804.4.0.114738908598.issue13396@psf.upfronthosting.co.za>
2011-11-13 19:50:03rhettingerlinkissue13396 messages
2011-11-13 19:50:03rhettingercreate