STINNER Victor <vstin...@python.org> added the comment:
Raymond: > 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. I don't see how 30 lines makes Python so harder to maintain. These lines make the function 4x to 5x faster. We are not talking about 5% or 10% faster. I think that such optimization is worth it. When did we decide to stop optimizing Python? Raymond: > The randbytes() method needs to depend on genrandbits(). I created bpo-40346: "Redesign random.Random class inheritance" for a more generic fix, not just randbytes(). Raymond: > 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 . This code was already modified to replace "unsigned long" with "uint32_t" for example. I don't think that renaming genrand_int32() to genrand_uint32() makes the code impossible to maintain. Moreover, it seems like http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html was not updated for 13 years. ---------- _______________________________________ 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