f1 = ns['f1']
f2 = ns['f2']
self.assertIsNot(f1.__code__, f2.__code__)
+ self.assertNotEqual(f1.__code__, f2.__code__)
self.check_constant(f1, const1)
self.check_constant(f2, const2)
self.assertEqual(repr(f1()), repr(const1))
check_different_constants(0, 0.0)
check_different_constants(+0.0, -0.0)
check_different_constants((0,), (0.0,))
+ check_different_constants('a', b'a')
+ check_different_constants(('a',), (b'a',))
# check_different_constants() cannot be used because repr(-0j) is
# '(-0-0j)', but when '(-0-0j)' is evaluated to 0j: we loose the sign.
PyTuple_SET_ITEM(tuple, i, item_key);
}
- key = PyTuple_Pack(3, Py_TYPE(op), op, tuple);
+ key = PyTuple_Pack(2, tuple, op);
Py_DECREF(tuple);
}
else if (PyFrozenSet_CheckExact(op)) {
if (set == NULL)
return NULL;
- key = PyTuple_Pack(3, Py_TYPE(op), op, set);
+ key = PyTuple_Pack(2, set, op);
Py_DECREF(set);
return key;
}
if (obj_id == NULL)
return NULL;
- key = PyTuple_Pack(3, Py_TYPE(op), op, obj_id);
+ key = PyTuple_Pack(2, obj_id, op);
Py_DECREF(obj_id);
}
return key;