[Python-checkins] CVS: python/dist/src/Objects object.c,2.113,2.114
Guido van Rossum
gvanrossum@users.sourceforge.net
Mon, 22 Jan 2001 11:28:11 -0800
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv579
Modified Files:
object.c
Log Message:
New special case in comparisons: None is smaller than any other object
(unless the object's type overrides this comparison).
Index: object.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v
retrieving revision 2.113
retrieving revision 2.114
diff -C2 -r2.113 -r2.114
*** object.c 2001/01/22 15:59:32 2.113
--- object.c 2001/01/22 19:28:09 2.114
***************
*** 551,554 ****
--- 551,560 ----
}
+ /* 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)