[issue31478] assertion failure in random.seed() in case the seed argument has a bad __abs__() method

Serhiy Storchaka report at bugs.python.org
Sun Oct 1 02:47:00 EDT 2017


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

I agree that a backport is still desirable.

Your plan LGTM. Implement __abs__ raising an exception (test both int ant long subclasses). Make sure that no error is raised. Make sure that random() returns the same value as when seeding with an exact int and long.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31478>
_______________________________________


More information about the Python-bugs-list mailing list