Package zope :: Package interface :: Module declarations :: Class ClassProvides
[show private | hide private]
[frames | no frames]

Type ClassProvides

                 object --+    
        ClassProvidesBasePy --+
         object --+           |
                  |           |
SpecificationBasePy --+       |
                      |       |
          Specification --+   |
                          |   |
                Declaration --+

Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.

For example:

>>> from zope.interface import Interface
>>> class IFooFactory(Interface):
...     pass
>>> class IFoo(Interface):
...     pass
>>> class C(object):
...     implements(IFoo)
...     classProvides(IFooFactory)
>>> [i.getName() for i in C.__provides__]

>>> [i.getName() for i in C().__provides__]

Method Summary
  __init__(self, cls, metacls, *interfaces)
  __get__(self, inst, cls)
    Inherited from Declaration
  __add__(self, other)
Add two specifications or a specification and an interface
  __contains__(self, interface)
Test whether an interface is in the specification
Return an iterator for the interfaces in the specification
Test whether there are any interfaces in a specification.
  __radd__(self, other)
Add two specifications or a specification and an interface
  __sub__(self, other)
Remove interfaces from a specification
We, or something we depend on, have changed
Return an iterator of all included and extended interfaces
    Inherited from Specification
  extends(self, interface, strict)
Does the specification extend the given interface?
  get(self, name, default)
Query for an attribute description
Return an iterator for the interfaces in the specification
  isImplementedBy(self, ob)
  isImplementedByInstancesOf(self, cls)
  isOrExtends(self, interface)
Is the interface the same as or extend the given interface
  providedBy(self, ob)
Is the interface implemented by an object
  subscribe(self, dependent)
  unsubscribe(self, dependent)
  weakref(self, callback)
    Inherited from SpecificationBasePy
  implementedBy(self, cls)
Do instances of the given class implement the interface?
    Inherited from object
x.__delattr__('name') <==> del
x.__getattribute__('name') <==>
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
helper for pickle
x.__repr__() <==> repr(x)
x.__setattr__('name', value) <==> = value
x.__str__() <==> str(x)

Property Summary
    Inherited from Specification

Class Variable Summary
    Inherited from Specification
Implements __implemented__ = <implementedBy zope.interface.interfac...
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...
    Inherited from SpecificationBasePy
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...

Generated by Epydoc 2.1 on Fri Jun 24 12:01:24 2005