Package logilab :: Package common :: Module interface

[frames] | no frames]

# Module interface

source code

    Bases class for interfaces to provide 'light' interface handling.

    TODO:
     _ implements a check method which check that an object implements the
       interface
     _ Attribute objects

     This module requires at least python 2.2

Classes
| Interface Base class for interfaces.

Functions

implements(obj, interface) Return true if the give object (maybe an instance or class) implements the interface. | source code

extend(klass, interface, _recurs=False) Add interface to klass'__implements__ if not already implemented in. | source code

Function Details

### extend(klass, interface, _recurs=False)

source code

    Add interface to klass'__implements__ if not already implemented in.

    If klass is subclassed, ensure subclasses __implements__ it as well.

    NOTE: klass should be e new class.