[Zope-CVS] CVS: Packages/pypes/pypes - identity.py:1.16

Casey Duncan casey at zope.com
Wed Mar 10 16:17:17 EST 2004


Update of /cvs-repository/Packages/pypes/pypes
In directory cvs.zope.org:/tmp/cvs-serv20069

Modified Files:
	identity.py 
Log Message:
__eq__ and __ne__ now return False instead of raising TypeError when comparing IdentitySets to other objects


=== Packages/pypes/pypes/identity.py 1.15 => 1.16 ===
--- Packages/pypes/pypes/identity.py:1.15	Sun Mar  7 05:09:12 2004
+++ Packages/pypes/pypes/identity.py	Wed Mar 10 16:16:46 2004
@@ -285,11 +285,16 @@
             raise TypeError, 'wrong type for issuperset'
         
     def __eq__(self, other):
-        return self.issubset(other) and self.issuperset(other)
+        try:
+            return self.issubset(other) and self.issuperset(other)
+        except TypeError:
+            return False
     
     def __ne__(self, other):
-        return not self.issubset(other) or not self.issuperset(other)
-        
+        try:
+            return not self.issubset(other) or not self.issuperset(other)
+        except TypeError:
+            return True
         
 ## Multi-set operations ##
 




More information about the Zope-CVS mailing list