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 Oren Milman
Recipients Oren Milman, rhettinger, serhiy.storchaka, veky
Date 2017-09-28.10:22:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1506594164.55.0.466225441844.issue31478@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2017-09-28 10:22:44Oren Milmansetrecipients: + Oren Milman, rhettinger, serhiy.storchaka, veky
2017-09-28 10:22:44Oren Milmansetmessageid: <1506594164.55.0.466225441844.issue31478@psf.upfronthosting.co.za>
2017-09-28 10:22:44Oren Milmanlinkissue31478 messages
2017-09-28 10:22:44Oren Milmancreate