Class
zope.app.container.contained.DecoratorSpecificationDescriptor

Support for interface declarations on decorators

>>> from zope.interface import *
>>> class I1(Interface):
...     pass
>>> class I2(Interface):
...     pass
>>> class I3(Interface):
...     pass
>>> class I4(Interface):
...     pass
>>> class D1(ContainedProxy):
...   implements(I1)
>>> class D2(ContainedProxy):
...   implements(I2)
>>> class X:
...   implements(I3)
>>> x = X()
>>> directlyProvides(x, I4)

Interfaces of X are ordered with the directly-provided interfaces first

>>> [interface.getName() for interface in list(providedBy(x))]
['I4', 'I3']

When we decorate objects, what order should the interfaces come in? One could argue that decorators are less specific, so they should come last.

>>> [interface.getName() for interface in list(providedBy(D1(x)))]
['I4', 'I3', 'I1', 'IContained', 'IPersistent']
>>> [interface.getName() for interface in list(providedBy(D2(D1(x))))]
['I4', 'I3', 'I1', 'IContained', 'IPersistent', 'I2']

Base classes

Implemented Interfaces

There are no implemented interfaces.

Attributes/Properties

There are no attributes in this class.

Methods

There are no methods in this class.

Known Subclasses

There are no known subclasses.