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

The randbytes() method needs to depend on genrandbits().  It is documented that 
custom generators can supply there own random() and genrandbits() methods and 
expect that the other downstream generators all follow.  See the attached 
example which demonstrates that randbytes() bypasses this framework pattern.

Also, I don't want randbytes() in the C extension.  We're tried to keep as much 
of the code as possible in pure Python and only have the MersenneTwister 
specific code in the C module.  The improves maintainability and makes the code 
more accessible to a broader audience.

Also, please don't change the name of the genrand_int32() function.  It was a 
goal to change as little as possible from the official, standard version of the 
C code at 
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html .  For 
the most part, we just want to wrap that code for Python bindings, but not 
modify it.

----------
status: closed -> open
Added file: https://bugs.python.org/file49078/run_random.py

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

Reply via email to