[Zope3-checkins] CVS: ZODB4/Interface - _InterfaceClass.py:1.9

Jeremy Hylton jeremy@zope.com
Wed, 9 Oct 2002 18:35:10 -0400


Update of /cvs-repository/ZODB4/Interface
In directory cvs.zope.org:/tmp/cvs-serv28847/Interface

Modified Files:
	_InterfaceClass.py 
Log Message:
Use True/False instead of 1/0


=== ZODB4/Interface/_InterfaceClass.py 1.8 => 1.9 ===
--- ZODB4/Interface/_InterfaceClass.py:1.8	Mon Jul 22 13:01:40 2002
+++ ZODB4/Interface/_InterfaceClass.py	Wed Oct  9 18:35:09 2002
@@ -86,44 +86,39 @@
         return self.__bases__
 
     def extends(self, other, strict=1):
-        """Does an interface extend another?
-        """
+        """Does an interface extend another?"""
         if not strict and self is other:
-            return 1
+            return True
         
         for b in self.__bases__:
-            if b == other: return 1
-            if b.extends(other): return 1
-        return 0
+            if b == other: return True
+            if b.extends(other): return True
+        return False
 
     def isEqualOrExtendedBy(self, other):
-        """Same interface or extends?
-        """
+        """Same interface or extends?"""
         if self == other:
-            return 1
+            return True
         return other.extends(self)
 
     def isImplementedBy(self, object):
-        """Does the given object implement the interface?
-        """
+        """Does the given object implement the interface?"""
         i = getImplements(object)
         if i is not None:
             return visitImplements(
                 i, object, self.isEqualOrExtendedBy, self._getInterface)
-        return 0
+        return False
 
     def isImplementedByInstancesOf(self, klass):
-        """Do instances of the given class implement the interface?
-        """
+        """Do instances of the given class implement the interface?"""
         i = getImplementsOfInstances(klass)
         if i is not None:
             return visitImplements(
                 i, klass, self.isEqualOrExtendedBy, self._getInterface)
-        return 0
+        return False
 
     def names(self, all=0):
-        """Return the attribute names defined by the interface
-        """
+        """Return the attribute names defined by the interface."""
         if not all:
             return self.__attrs.keys()