[Twisted-Python] Re: [Zope3-dev] Twisted and Component Architecture

Jim Fulton jim at zope.com
Tue Apr 23 09:29:05 EDT 2002

Itamar Shtull-Trauring wrote:
> Well, since it's been mentioned here, guess I'll step in.
> First, I implemented a simplistic system because I needed adapters for
> Twisted's config system (it used to use mixin classes *shudder*), so I
> quickly wrote up something which implemented them. The fact that
> __implements__ checks the class is an implementation artifact - I can
> easily change it so it works like Zope3's.


> Which brings us to the next issue - should I be using Zope3's CA?
> Apparently I can't - Twisted is intended to run on 1.5.2 upwards, and
> even we drop 1.5.2 support we will be using 2.1 as the baseline.
> Interface packages and CA package are 2.2 only.

Hm. I don't remember if there's any important reason why the Interface
and ComponentArchitecture packages depend on python 2.2. I suspect that
there isn't. Assuming that there is no important reason for them to
depend on 2.2, I'd be happy to see them work with Python 2 or, if necessary
Python 1.5. Perhaps, as Phillip suggests, it would be best to focus on
interfaces. I ended up doing a bunch of cleanup and refactoring in the
Interface package for Zope 3 and it would be nice to make that available
for earlier versions of Python, especially Python 2.
> So, this is what I think I'll do - I'll refactor the minimum
> implementation Twisted's uses, making sure that it uses the same
> semantics and syntax as Zope3's (e.g. __implements__ being a
> tuple/singelton instead of lists - why was this made inconsistent in
> Zope, anyway?).

Inconsistent? With what? Tuples and interfaces are allowed so that:

  - it's easy to spell implementing one interface:

      __implements__ = Ifoo

    which is very common

  - make it easy to compose implementation specifications:

      __implements__ = IFoo, some_base_class.__implements__

  - Make the specifications immutable to facilitate caching.

> If Zope3 is importable then Zope.CA's implementation
> will be used instead.
> Any issues anyone can think of in doing this?

CA is a lot younger than Interface, so it's still changing quite
a bit. You might want to wait a little longer for the changes to
settle out.

Let us know what you want to do and we'll be willing to port the
software back.


Jim Fulton           mailto:jim at zope.com       Python Powered!        
CTO                  (888) 344-4332            http://www.python.org  
Zope Corporation     http://www.zope.com       http://www.zope.org

More information about the Twisted-Python mailing list