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 mark.dickinson, rhettinger, serhiy.storchaka, veky, vstinner
Date 2020-04-20.18:17:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1587406678.98.0.455403120595.issue40286@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-04-20 18:17:59rhettingersetrecipients: + rhettinger, mark.dickinson, vstinner, serhiy.storchaka, veky
2020-04-20 18:17:58rhettingersetmessageid: <1587406678.98.0.455403120595.issue40286@roundup.psfhosted.org>
2020-04-20 18:17:58rhettingerlinkissue40286 messages
2020-04-20 18:17:58rhettingercreate