[Zope3-checkins] CVS: Zope3/src/zope/app/utilities - schema.py:1.13

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Dec 16 05:32:07 EST 2003


Update of /cvs-repository/Zope3/src/zope/app/utilities
In directory cvs.zope.org:/tmp/cvs-serv15115/src/zope/app/utilities

Modified Files:
	schema.py 
Log Message:
eek, this was a combination of a small interfacewidget typo and a case of 
not having mutableschema code synced with the static interface implementation


=== Zope3/src/zope/app/utilities/schema.py 1.12 => 1.13 ===
--- Zope3/src/zope/app/utilities/schema.py:1.12	Fri Nov 21 12:09:34 2003
+++ Zope3/src/zope/app/utilities/schema.py	Tue Dec 16 05:32:06 2003
@@ -148,15 +148,12 @@
     def getBases(self):
         return [b for b in self.__bases__ if isinstance(b, self.__class__)]
 
-    def extends(self, other, strict=True):
+    def extends(self, interface, strict=True):
         """Does an interface extend another?"""
-        if not strict and self == other:
-            return True
-
-        for b in self.getBases():
-            if b == other: return True
-            if b.extends(other): return True
-        return False
+        return ((interface in self._implied)
+                and
+                ((not strict) or (self != interface))
+                )
 
     def names(self, all=False):
         """Return the attribute names defined by the interface."""




More information about the Zope3-Checkins mailing list