mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
Add py3k warnings for object, type, cell and dict comparisons. This should resolve issue2342 and partly resolve issue2373.
This commit is contained in:
parent
a8b09fd4c3
commit
ae42f33cdf
6 changed files with 166 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue