Message303207
With regard to backporting to 2.7:
In 2.7 also, PyNumber_Absolute() is called, and its return value is stored in
the variable n.
However, there is no _PyLong_NumBits(n), so there is no assertion failure.
If n isn't an integer:
- if !PyObject_IsTrue(n), then the seed is zero (e.g. if n is None, [], () or {})
- otherwise, PyNumber_And() and PyNumber_Rshift() are used in a loop on n, so
probably a TypeError would be raised.
So I think a backport is still desirable, but i am not sure about the test.
Maybe we should use @cpython_only, and make sure that no error is raised?
We can also make sure that random() returns a different value than when the
seed is zero.
What do you think? |
|
Date |
User |
Action |
Args |
2017-09-28 10:22:44 | Oren Milman | set | recipients:
+ Oren Milman, rhettinger, serhiy.storchaka, veky |
2017-09-28 10:22:44 | Oren Milman | set | messageid: <1506594164.55.0.466225441844.issue31478@psf.upfronthosting.co.za> |
2017-09-28 10:22:44 | Oren Milman | link | issue31478 messages |
2017-09-28 10:22:44 | Oren Milman | create | |
|