> > My only concern is that under the old schele, two different numeric > > extension types that somehow can't be compared will end up being > > *equal*. To fix this, I propose that if the names compare equal, as a > > last resort we compare the type pointers -- this should be consistent > > too. > > Agreed, and sounds fine! Checked in now. While fixing the test_b1 code again, which depends on this behavior, I thought of a refinement: it wouldn't be hard to make None compare smaller than *anything* (including numbers). Is this worth it? diff -c -r2.113 object.c *** object.c 2001/01/22 15:59:32 2.113 --- object.c 2001/01/22 16:03:38 *************** *** 550,555 **** --- 550,561 ---- PyErr_Clear(); } + /* None is smaller than anything */ + if (v == Py_None) + return -1; + if (w == Py_None) + return 1; + /* different type: compare type names */ if (v->ob_type->tp_as_number) vname = ""; --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4