Hi all,

I'm just playing with an SchemaUtility that extends another file system defined schema, and I think I've found a little bug. Here's the case:

from zope.app.schema.schema import SchemaUtility
from kmkey.interfaces.economics import IProduct
p = SchemaUtility()
p = SchemaUtility(bases=(IProduct,))

Applying the patch I attach then it works as expected:

[<InterfaceClass kmkey.interfaces.economics.IProduct>]
['selling_price', 'description', 'name']

I'm certain, is this a bug, or I'm doing something wrong ? If first case, I will add an entry to the bugs collector.


Santi Camps

Index: zope/app/schema/schema.py
--- zope/app/schema/schema.py	(revision 33325)
+++ zope/app/schema/schema.py	(working copy)
@@ -144,7 +144,7 @@
     # and __bases__. Changed __attrs to _attrs, which is a PersistentDict,
     # and __bases__ to getBases(), whic filters instances of InterfaceClass
     def getBases(self):
-        return [b for b in self.__bases__ if isinstance(b, self.__class__)]
+        return [b for b in self.__bases__ if isinstance(b, InterfaceClass)]
     def extends(self, interface, strict=True):
         """Does an interface extend another?"""
Zope3-dev mailing list
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to