[Interface-dev] Twisted switch progress report

Jim Fulton jim at zope.com
Mon May 10 15:10:48 EDT 2004


Itamar Shtull-Trauring wrote:
> On Mon, 2004-05-10 at 13:58, Jim Fulton wrote:
> 
> 
>>Your fixup code should make __implements__ a descriptor that calls
>>implementedBy.
> 
> 
> Er. What I currently do is, when encountering class that has
> __implements__ (currently only in one function but soon in all code
> paths that might encounter it):
> 
>     for i in tupleTreeToList(klass.__implements__):
>         declarations.classImplements(klass, i)
> 
> What are you suggesting I do instead? And how would I solve the problem
> I mentioned in my previous email with subclasses?
> 

Actually, come to think of it, *after* Martijn's changes havce landed,
you can leave __implements__ alone, since zope.interface will no longer
use it. :) Then you have no problem with subclasses.

You can keep your adapter-fixup code which should do:

   declarations.classImplementsOnly(klass, *tupleTreeToList(klass.__implements__))

Note the "Only", which preserves the non-inheriting semantics of __implements__.

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org



More information about the Interface-dev mailing list