mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-37648: Fixed minor inconsistency in some __contains__. (GH-14904)
The collection's item is now always at the left and the needle is on the right of ==.
This commit is contained in:
parent
17e52649c0
commit
18b711c5a7
12 changed files with 86 additions and 22 deletions
|
@ -2016,7 +2016,7 @@ _PySequence_IterSearch(PyObject *seq, PyObject *obj, int operation)
|
|||
break;
|
||||
}
|
||||
|
||||
cmp = PyObject_RichCompareBool(obj, item, Py_EQ);
|
||||
cmp = PyObject_RichCompareBool(item, obj, Py_EQ);
|
||||
Py_DECREF(item);
|
||||
if (cmp < 0)
|
||||
goto Fail;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue