[Python-checkins] python/dist/src/Objects listobject.c,2.144,2.145

montanaro@users.sourceforge.net montanaro@users.sourceforge.net
Thu, 02 Jan 2003 12:51:10 -0800


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1:/tmp/cvs-serv5845/Objects

Modified Files:
	listobject.c 
Log Message:
Allow list sort's comparison function to explicitly be None.  See SF patch
661092.


Index: listobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v
retrieving revision 2.144
retrieving revision 2.145
diff -C2 -d -r2.144 -r2.145
*** listobject.c	29 Dec 2002 16:33:11 -0000	2.144
--- listobject.c	2 Jan 2003 20:51:08 -0000	2.145
***************
*** 1658,1661 ****
--- 1658,1664 ----
  			return NULL;
  	}
+ 	if (compare == Py_None)
+ 		compare = NULL;
+ 
  	merge_init(&ms, compare);
  
***************
*** 2070,2074 ****
  "L.reverse() -- reverse *IN PLACE*");
  PyDoc_STRVAR(sort_doc,
! "L.sort([cmpfunc]) -- stable sort *IN PLACE*; cmpfunc(x, y) -> -1, 0, 1");
  
  static PyMethodDef list_methods[] = {
--- 2073,2077 ----
  "L.reverse() -- reverse *IN PLACE*");
  PyDoc_STRVAR(sort_doc,
! "L.sort(cmpfunc=None) -- stable sort *IN PLACE*; cmpfunc(x, y) -> -1, 0, 1");
  
  static PyMethodDef list_methods[] = {