[Twisted-Python] Removal of deprecated twisted.python.components functionality
Everything that was previously marked as deprecated in twisted.python.components (and has been since Twisted 2.0) is now being removed. fixClassImplements and backwardsCompatImplements are now no-ops, and if you have them in any of your code, you should remove them. Unfortunately we missed deprecating a few things, so not everything has been able to be removed yet. The most important thing that will be going but has not yet is the adaptation function call with a "default" keyword argument, as in: "IFoo(obj, default=whatever)". Zope.Interface calls the second arg "alternate" instead of "default", which is an incompatibility. Because of this, the Interfaces definitions in twisted cannot be changed to be straight zope.interface.Interface classes yet, and must still be t.p.c.Interface for at least another release to allow people to fix programs using the old "default" argument. (it now does give a deprecation warning suggesting replacing it with a positional second argument). Most things are gone, what's left undeprecated is: ComponentsDeprecationWarning registerAdapter getAdapterFactory Adapter Componentized ReprableComponentized getRegistry And what's still there for now, newly deprecated: Interface getAdapterClass getAdapterClassWithInheritance backwardsCompatImplements fixClassImplements The exception class CannotAdapt is an alias for TypeError, so you should use that directly, although the attribute cannot be actually deprecated. James
participants (1)
-
James Y Knight