[Zope3-dev] Twisted framework refactored

Phillip J. Eby pje@telecommunity.com
Sat, 20 Apr 2002 12:37:42 -0500


At 12:01 PM 4/20/02 -0400, Jeff Kowalczyk wrote:
>Somewhat mixed implications from the Twisted Framework's
>http://twistedmatrix.com/ latest code refactoring. Based the Freshmeat
>entry, I was hopeful that a collaboration was nearing for the two
>projects, to minimize duplication of effort for the plethora of
>protocols twisted supports, but Zope's app server framework could make
>ready use of. The changelog's perspective is somewhat different,
>however.

I saw the same thing this morning, and took a look at the 
code.  Unfortunately it's not only an independent re-implementation of a 
portion of the Zope 3 Component Architecture, it's a largely incompatible 
re-implementation.  It has different implementation semantics for 
Interfaces and the '__implements__' protocol, in ways that aren't fully 
compatible with *any* version of the Zope Interface package, AFAICT.

Because of the differences in '__implements__', the work I've done in 
TransWarp to make Python 2.2 metaclasses play nicely with both 2.x and 3X 
Interfaces will break horribly with twisted.python.components.  :(

The difference, for anyone who cares, is that Twisted specifically 
considers '__implements__' to be a *class* attribute, not an instance 
attribute.  This eliminates the distinction between '__implements__' and 
'__class_implements__', at the cost of making it impossible to declare 
metaclass-level interfaces.