Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

> 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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13396>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to