Message366860
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. |
|
Date |
User |
Action |
Args |
2020-04-20 18:17:59 | rhettinger | set | recipients:
+ rhettinger, mark.dickinson, vstinner, serhiy.storchaka, veky |
2020-04-20 18:17:58 | rhettinger | set | messageid: <1587406678.98.0.455403120595.issue40286@roundup.psfhosted.org> |
2020-04-20 18:17:58 | rhettinger | link | issue40286 messages |
2020-04-20 18:17:58 | rhettinger | create | |
|