Author Oren Milman
Recipients Oren Milman
Date 2017-09-14.20:33:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The following code causes an assertion failure:
class BadInt(int):
    def __abs__(self):
        return None

import random


this is because random_seed() (in Modules/_randommodule.c) assumes that
PyNumber_Absolute() returned an int, and so it passes it to _PyLong_NumBits(),
which asserts it received an int.

what should we do in such a case?
should we raise an exception? (the docs don't mention abs() in case the seed is
an int -
Date User Action Args
2017-09-14 20:33:46Oren Milmansetrecipients: + Oren Milman
2017-09-14 20:33:46Oren Milmansetmessageid: <>
2017-09-14 20:33:46Oren Milmanlinkissue31478 messages
2017-09-14 20:33:46Oren Milmancreate