[Zope-dev] zope.interface: verifyObject vs properties

Dieter Maurer dieter at handshake.de
Fri Oct 17 15:07:26 EDT 2008


Thomas Lotze wrote at 2008-10-17 19:42 +0200:
>"Dieter Maurer" <dieter at handshake.de> schrieb:
>> ...
>> Instance properties (descriptor on the class) may not define methods
>> (probably a bug).
>
>I don't understand what you're saying in that last sentence; can you
>elaborate?

"verifyObject/verifyClass" is likely not to handle the following
case correctly:

     class I(Interface):
       def m(...):
         ...

     class C(object):
       implements(I)
       m = property(lambda self: lambda ...: ...)


i.e. when a method (declared by the interface) is implemented by a property.


--
Dieter


More information about the Zope-Dev mailing list