[pywin32-checkins] pywin32/com/win32com/client __init__.py, 1.39, 1.40 dynamic.py, 1.29, 1.30
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2009-02-04 04:01:31
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21528/com/win32com/client Modified Files: __init__.py dynamic.py Log Message: Remove __cmp__ and tp_compare slots from COM objects and return Py_NotImplemented in richcmp functions when faced with different types. Index: dynamic.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/dynamic.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** dynamic.py 28 Jan 2009 11:37:02 -0000 1.29 --- dynamic.py 4 Feb 2009 04:01:25 -0000 1.30 *************** *** 201,212 **** # Delegate comparison to the oleobjs, as they know how to do identity. - def __cmp__(self, other): - other = getattr(other, "_oleobj_", other) - return cmp(self._oleobj_, other) - def __eq__(self, other): other = getattr(other, "_oleobj_", other) return self._oleobj_ == other def __int__(self): return int(self.__call__()) --- 201,212 ---- # Delegate comparison to the oleobjs, as they know how to do identity. def __eq__(self, other): other = getattr(other, "_oleobj_", other) return self._oleobj_ == other + def __ne__(self, other): + other = getattr(other, "_oleobj_", other) + return self._oleobj_ != other + def __int__(self): return int(self.__call__()) Index: __init__.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/__init__.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** __init__.py 4 Jan 2009 22:35:14 -0000 1.39 --- __init__.py 4 Feb 2009 04:01:25 -0000 1.40 *************** *** 444,455 **** return "<%s.%s instance at 0x%s>" % (mod_name, self.__class__.__name__, id(self)) # Delegate comparison to the oleobjs, as they know how to do identity. - def __cmp__(self, other): - other = getattr(other, "_oleobj_", other) - return cmp(self._oleobj_, other) - def __eq__(self, other): other = getattr(other, "_oleobj_", other) return self._oleobj_ == other def _ApplyTypes_(self, dispid, wFlags, retType, argTypes, user, resultCLSID, *args): return self._get_good_object_( --- 444,455 ---- return "<%s.%s instance at 0x%s>" % (mod_name, self.__class__.__name__, id(self)) # Delegate comparison to the oleobjs, as they know how to do identity. def __eq__(self, other): other = getattr(other, "_oleobj_", other) return self._oleobj_ == other + def __ne__(self, other): + other = getattr(other, "_oleobj_", other) + return self._oleobj_ != other + def _ApplyTypes_(self, dispid, wFlags, retType, argTypes, user, resultCLSID, *args): return self._get_good_object_( |