Change the way __hash__ is inherited; when __eq__ or __cmp__ is overridden

but __hash__ is not, set __hash__ explicitly to None (and tp_hash to NULL).
All unit tests pass now!
This commit is contained in:
Guido van Rossum 2006-08-21 23:36:26 +00:00
parent 5431ee4a49
commit 389381564c
6 changed files with 65 additions and 72 deletions

View file

@ -320,9 +320,16 @@ PyObject_Print(PyObject *op, FILE *fp, int flags)
return internal_print(op, fp, flags, 0);
}
/* For debugging convenience. Set a breakpoint here and call it from your DLL */
void
_Py_Break(void)
{
}
/* For debugging convenience. See Misc/gdbinit for some useful gdb hooks */
void _PyObject_Dump(PyObject* op)
void
_PyObject_Dump(PyObject* op)
{
if (op == NULL)
fprintf(stderr, "NULL\n");