diff options
author | Victor Stinner <vstinner@python.org> | 2023-12-07 13:41:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-07 13:41:00 (GMT) |
commit | f27271619e7606338d194d669bbab4823517f7be (patch) | |
tree | 8c6bb67022e7456935ec1b7465c9a53f236e9f0a /Objects | |
parent | e21a7a976a7e3368dc1eba0895e15c47cb06c810 (diff) | |
download | cpython-f27271619e7606338d194d669bbab4823517f7be.zip cpython-f27271619e7606338d194d669bbab4823517f7be.tar.gz cpython-f27271619e7606338d194d669bbab4823517f7be.tar.bz2 |
[3.12] gh-112125: Fix None.__ne__(None) returning NotImplemented instead of … (#112827)
gh-112125: Fix None.__ne__(None) returning NotImplemented instead of False (#112504)
(cherry picked from commit 9c3458e05865093dd55d7608810a9d0ef0765978)
Co-authored-by: andrewluotechnologies <44252973+andrewluotechnologies@users.noreply.github.com>
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/object.c | 2 | ||||
-rw-r--r-- | Objects/typeobject.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/Objects/object.c b/Objects/object.c index 8a4010f..aac707d 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -1878,7 +1878,7 @@ PyTypeObject _PyNone_Type = { 0, /*tp_doc */ 0, /*tp_traverse */ 0, /*tp_clear */ - 0, /*tp_richcompare */ + _Py_BaseObject_RichCompare, /*tp_richcompare */ 0, /*tp_weaklistoffset */ 0, /*tp_iter */ 0, /*tp_iternext */ diff --git a/Objects/typeobject.c b/Objects/typeobject.c index d0c7c5f..71d2068 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -5593,6 +5593,12 @@ object_richcompare(PyObject *self, PyObject *other, int op) return res; } +PyObject* +_Py_BaseObject_RichCompare(PyObject* self, PyObject* other, int op) +{ + return object_richcompare(self, other, op); +} + static PyObject * object_get_class(PyObject *self, void *closure) { |