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

Tres Seaver tseaver at palladion.com
Fri Oct 17 15:14:18 EDT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dieter Maurer wrote:
> 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.

Why would I want to do that, rather than using 'def m(self):'?


Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFI+OQK+gerLs4ltQ4RAjhgAJ9hS2kbePps6Ka2yqK8gOF94XOmlgCg1HWc
y/uPVTUWU3e7p6PZROToHLY=
=UCfg
-----END PGP SIGNATURE-----



More information about the Zope-Dev mailing list