Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b638aaf commit 6d60b2eCopy full SHA for 6d60b2e
1 file changed
Objects/object.c
@@ -447,7 +447,7 @@ try_rich_to_3way_compare(PyObject *v, PyObject *w)
447
for (i = 0; i < 3; i++) {
448
switch (try_rich_compare_bool(v, w, tries[i].op)) {
449
case -1:
450
- return -1;
+ return -2;
451
case 1:
452
return tries[i].outcome;
453
}
@@ -585,6 +585,12 @@ default_3way_compare(PyObject *v, PyObject *w)
585
586
#define CHECK_TYPES(o) PyType_HasFeature((o)->ob_type, Py_TPFLAGS_CHECKTYPES)
587
588
+/* Do a 3-way comparison, by hook or by crook. Return:
589
+ -2 for an exception;
590
+ -1 if v < w;
591
+ 0 if v == w;
592
+ 1 if v > w;
593
+*/
594
static int
595
do_cmp(PyObject *v, PyObject *w)
596
{
0 commit comments