Update of /cvsroot/pywin32/pywin32/com/win32com/client
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10882/client
Modified Files:
__init__.py combrowse.py dynamic.py
Log Message:
add __eq__ method for rich comparisons for py3k
Index: combrowse.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/combrowse.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** combrowse.py 11 Dec 2008 06:54:52 -0000 1.13
--- combrowse.py 4 Jan 2009 22:35:14 -0000 1.14
***************
*** 37,40 ****
--- 37,42 ----
def __cmp__(self, other):
return cmp(self.name, other.name)
+ def __eq__(self, other):
+ return self.name==other.name
class HLICOM(browser.HLIPythonObject):
Index: dynamic.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/dynamic.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** dynamic.py 4 Dec 2008 03:18:32 -0000 1.27
--- dynamic.py 4 Jan 2009 22:35:14 -0000 1.28
***************
*** 204,207 ****
--- 204,211 ----
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__())
Index: __init__.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/__init__.py,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** __init__.py 4 Dec 2008 03:18:32 -0000 1.38
--- __init__.py 4 Jan 2009 22:35:14 -0000 1.39
***************
*** 448,451 ****
--- 448,455 ----
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_(
|