[Python-checkins] CVS: python/dist/src/Lib UserList.py,1.16,1.17
Martin v. L?wis
loewis@users.sourceforge.net
Sat, 09 Jun 2001 00:34:07 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv9798/Lib
Modified Files:
UserList.py
Log Message:
Patch #424475: Speed-up tp_compare usage, by special-casing the common
case of objects with equal types which support tp_compare. Give
type objects a tp_compare function.
Also add c<0 tests before a few PyErr_Occurred tests.
Index: UserList.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/UserList.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** UserList.py 2001/02/18 03:30:53 1.16
--- UserList.py 2001/06/09 07:34:05 1.17
***************
*** 23,27 ****
else: return other
def __cmp__(self, other):
! raise RuntimeError, "UserList.__cmp__() is obsolete"
def __contains__(self, item): return item in self.data
def __len__(self): return len(self.data)
--- 23,27 ----
else: return other
def __cmp__(self, other):
! return cmp(self.data, self.__cast(other))
def __contains__(self, item): return item in self.data
def __len__(self): return len(self.data)