Add py3k warnings for object, type, cell and dict comparisons. This should resolve issue2342 and partly resolve issue2373.

This commit is contained in:
Steven Bethard 2008-03-18 17:26:10 +00:00
parent a8b09fd4c3
commit ae42f33cdf
6 changed files with 166 additions and 3 deletions

View file

@ -1776,8 +1776,14 @@ dict_richcompare(PyObject *v, PyObject *w, int op)
return NULL;
res = (cmp == (op == Py_EQ)) ? Py_True : Py_False;
}
else
else {
/* Py3K warning if comparison isn't == or != */
if (Py_Py3kWarningFlag && PyErr_Warn(PyExc_DeprecationWarning,
"dict inequality comparisons not supported in 3.x.") < 0) {
return NULL;
}
res = Py_NotImplemented;
}
Py_INCREF(res);
return res;
}