[Twisted-Python] Notes on switching twisted to new zope.interface code

Andrew Bennetts andrew-twisted at puzzling.org
Thu Jul 22 20:08:39 MDT 2004


On Sun, Jul 18, 2004 at 10:39:24PM -0400, Itamar Shtull-Trauring wrote:
[...]
> 3. Basically all of t.p.c is deprecated except for registerAdapter and
> the other APIs that talk to registry. Componentized is not, in theory,
> but hopefully will be replaced soon.

4. If you use zope.interface.providedBy, and you want to work with code that
might not have been updated yet, call components.fixClassImplements, e.g.:

    components.fixClassImplements(obj)
    for i in interface.providedBy(obj):
        ...

I just fixed a bug in newcred where it didn't do this, so it broke a bunch
of PB tests.  Please be careful to test your changes work with old classes
that still use __implements__, not to mention make sure you run the test
suite!

-Andrew.





More information about the Twisted-Python mailing list