def __hash__(self):
return -1729
for arg in [None, 0, 1, -1, 10**20, -(10**20),
- 3.14, 'a']:
+ False, True, 3.14, 'a']:
self.gen.seed(arg)
for arg in [1+2j, tuple('abc'), MySeed()]:
uint32_t *key = NULL;
size_t bits, keyused;
int res;
- PyObject *args[1];
if (arg == NULL || arg == Py_None) {
if (random_seed_urandom(self) < 0) {
} else if (PyLong_Check(arg)) {
/* Calling int.__abs__() prevents calling arg.__abs__(), which might
return an invalid value. See issue #31478. */
- args[0] = arg;
- n = PyObject_Vectorcall(_randomstate_global->Long___abs__, args, 0,
- NULL);
+ n = PyObject_CallOneArg(_randomstate_global->Long___abs__, arg);
}
else {
Py_hash_t hash = PyObject_Hash(arg);