A Python interface library that disallows function body content on interfaces and supports adaption.
Jump to the Reference.
- Prevents code in method bodies of an interface class
- Ensures that method overrides have compatible signatures
- Supports interface adaption.
- Supports optional structural type checking for
Interface.provided_by(a)andInterface.adapt(a) - Allows concrete implementations the flexibility to implement abstract properties as instance attributes.
Interface.adapt()can return an implementation wrapper that provides only the attributes and methods defined byInterface.- Warns if
provided_bydid a structural type check when inheritance would work. - Supports python 3.8+
The phrase pure interface applies only to the first design goal - a class that defines only an interface with no implementation is a pure interface [*]. In every other respect the zen of 'practicality beats purity' applies.
You can install released versions of pure_interface using pip:
pip install pure-interface
or you can grab the source code from GitHub.
For simplicity in these examples we assume that the entire pure_interface namespace has been imported
from pure_interface import *
To define an interface, simply inherit from the class Interface and write a PEP-544 Protocol-like class
leaving all method bodies empty:
class IAnimal(Interface):
height: float
def speak(self, volume):
pass
Like Protocols, class annotations are considered part of the interface. In for historical reasons, you can also use the following alternate syntax:
class IAnimal(Interface):
height = None
def speak(self, volume):
pass
The value assigned to class attributes must be None and the attribute is removed from the class dictionary
(since annotations are not in the class dictionary).
Interface is a subtype of abc.ABC and the abstractmethod, abstractclassmethod and abstractstaticmethod decorators work as expected.
ABC-style property definitions are also supported (and equivalent):
class IAnimal(Interface):
@property
@abstractmethod
def height(self):
pass
@abstractmethod
def speak(self, volume):
pass
Again, the height property is removed from the class dictionary, but, as with the other syntaxes,
all concrete subclasses will be required to have a height attribute.
However the abstractmethod decorator is optional as ALL methods and properties on a Interface subclass are abstract.
In the examples above, both height and speak are considered abstract and must be overridden by subclasses.
Including abstractmethod decorators in your code can be useful for reminding yourself (and telling your IDE) that you need
to override those methods. Another common way of informing an IDE that a method needs to be overridden is for
the method to raise NotImplementedError. For this reason methods that just raise NotImplementedError are also
considered empty.
Interface classes cannot be instantiated
IAnimal() InterfaceError: Interfaces cannot be instantiated.
Including code in a method will result in an InterfaceError being raised when the module is imported. For example:
class BadInterface(Interface):
def method(self):
print('hello')
InterfaceError: Function "method" is not empty
Did you forget to inherit from object to make the class concrete?
The dir() function will include all interface attributes so that mock.Mock(spec=IAnimal) will work as expected:
>>> dir(IAnimal) ['__abstractmethods__', '__doc__', ..., 'height', 'speak']
The mock_protocol package also works well with interfaces.
Simply inheriting from a pure interface and writing a concrete class will result in an InterfaceError exception
as pure_interface will assume you are creating a sub-interface. To tell pure_interface that a type should be
concrete simply inherit from object as well (or anything else that isn't an Interface). For example:
class Animal(IAnimal, object):
def __init__(self, height):
self.height = height
def speak(self, volume):
print('hello')
Exception: Mixing an Interface class with an abc.ABC interface class that only defines abstract methods
and properties that satisfy the empty method criteria will result in a type that is considered a pure interface.:
class ABCInterface(abc.ABC):
@abstractmethod
def foo(self):
pass
class MyInterface(ABCInterface, Interface):
def bar(self):
pass
Concrete implementations may implement interface attributes in any way they like: as instance attributes, properties or
custom descriptors, provided that they all exist at the end of __init__(). Here is another valid implementation:
class Animal(IAnimal, object):
def __init__(self, height):
self._height = height
@property
def height(self):
return self._height
def speak(self, volume):
print('hello')
Method overrides are checked for compatibility with the interface. This means that argument names must match exactly and that no new non-optional arguments are present in the override. This enforces that calling the method with interface parameters will aways work. For example, given the interface method:
def speak(self, volume):
Then these overrides will all fail the checks and raise an InterfaceError:
def speak(self): # too few parameters def speak(self, loudness): # name does not match def speak(self, volume, language): # extra required argument
However new optional parameters are permitted, as are *args and **kwargs:
def speak(self, volume, language='doggy speak') def speak(self, *args, **kwargs)
As with abc.ABC, the abstract method checking for a class is done when an object is instantiated.
However it is useful to know about missing methods sooner than that. For this reason pure_interface will issue
a warning during module import when methods are missing from a concrete subclass. For example:
class SilentAnimal(IAnimal, object):
def __init__(self, height):
self.height = height
will issue this warning:
readme.py:28: UserWarning: Incomplete Implementation: SilentAnimal does not implement speak class SilentAnimal(IAnimal, object):
Trying to create a SilentAnimal will fail in the standard abc way:
SilentAnimal() InterfaceError: Can't instantiate abstract class SilentAnimal with abstract methods speak
If you have a mixin class that implements part of an interface you can suppress the warnings by adding an class attribute
called pi_partial_implementation. The value of the attribute is ignored, and the attribute itself is removed from
the class. For example:
class HeightMixin(IAnimal, object):
pi_partial_implementation = True
def __init__(self, height):
self.height = height
will not issue any warnings.
The warning messages are also appended to the module variable missing_method_warnings, irrespective of any warning
module filters (but only if get_is_development() returns True). This provides an alternative to raising warnings as errors.
When all your imports are complete you can check if this list is empty.:
if pure_iterface.missing_method_warnings:
for warning in pure_iterface.get_missing_method_warnings():
print(warning)
exit(1)
Note that missing properties are NOT checked for as they may be provided by instance attributes.
Sometimes your code only uses a small part of a large interface. It can be useful (eg. for test mocking) to specify
the sub part of the interface that your code requires. This can be done with the sub_interface_of decorator.:
@sub_interface_of(IAnimal)
class IHeight(pure_interface.Interface):
height: float
def my_code(h: IHeight):
return "That's tall" if h.height > 100 else "Not so tall"
The sub_interface_of decorator checks that the attributes and methods of the smaller interface match the larger interface.
Function signatures must match exactly (not just be compatible). The decorator will also use abc.register so that
isinstance(Animal(), IHeight) returns True.
Adapters for an interface are registered with the adapts decorator or with
the register_adapter function. Take for example an interface ISpeaker and a
class Talker and an adapter class TalkerToSpeaker:
class ISpeaker(Interface):
def speak(self, volume):
pass
class Talker(object):
def talk(self):
return 'talk'
@adapts(Talker)
class TalkerToSpeaker(ISpeaker, object):
def __init__(self, talker):
self._talker = talker
def speak(self, volume):
return self._talker.talk()
The adapts decorator call above is equivalent to:
register_adapter(TalkerToSpeaker, Talker, ISpeaker)
The ISpeaker parameter passed to register_adapter is the first interface in the MRO of the class being decorated (TalkerToSpeaker).
If there are no interface types in the MRO of the decorated class an InterfaceError exception is raised.
Adapter factory functions can be decorated too, in which case the interface being adapted to needs to be specified:
@adapts(Talker, ISpeaker)
def talker_to_speaker(talker):
return TalkerToSpeaker(talker)
The decorated adapter (whether class for function) must be callable with a single parameter - the object to adapt.
The Interface.adapt method will adapt an object to the given interface
such that Interface.provided_by is True or raise AdaptionError if no adapter could be found. For example:
speaker = ISpeaker.adapt(talker) isinstance(speaker, ISpeaker) --> True
If you want to get None rather than an exception then use:
speaker = ISpeaker.adapt_or_none(talker)
You can filter a list of objects returning those objects that provide an interface
using filter_adapt(objects):
list(ISpeaker.filter_adapt([None, Talker(), a_speaker, 'text']) --> [TalkerToSpeaker, a_speaker]
To adapt an object only if it is not None then use:
ISpeaker.optional_adapt(optional_talker)
This is equivalent to:
ISpeaker.adapt(optional_talker) if optional_talker is not None else None
By default the adaption functions will return an object which provides only
the functions and properties specified by the interface. For example given the
following implementation of the ISpeaker interface above:
class TopicSpeaker(ISpeaker):
def __init__(self, topic):
self.topic = topic
def speak(self, volume):
return 'lets talk about {} very {}'.format(self.topic, volume)
topic_speaker = TopicSpeaker('python')
Then:
speaker = ISpeaker.adapt(topic_speaker)
speaker is topic_speaker --> False
speaker.topic --> AttributeError("ISpeaker interface has no attribute topic")
This is controlled by the optional interface_only parameter to adapt which defaults to True.
Pass interface_only=False if you want the actual adapted object rather than a wrapper:
speaker = ISpeaker.adapt(topic_speaker, interface_only=False) speaker is topic_speaker --> True speaker.topic --> 'Python'
Accessing the topic attribute on an ISpeaker may work for all current implementations
of ISpeaker, but this code will likely break at some inconvenient time in the future.
Adapters from sub-interfaces may be used to perform adaption if necessary. For example:
class IA(Interface):
foo = None
class IB(IA):
bar = None
@adapts(int):
class IntToB(IB, object):
def __init__(self, x):
self.foo = self.bar = x
Then IA.adapt(4) will use the IntToB adapter to adapt 4 to IA (unless there is already an adapter
from int to IA)
Further, if an interface is decorated with sub_interface_of, adapters for the larger interface will be used if
a direct adapter is not found.
Structural type checking checks if an object has the attributes and methods defined by the interface.
As interfaces are inherited, you can usually use isinstance(obj, MyInterface) to check if an interface is provided.
An alternative to isinstance() is the Interface.provided_by(obj) classmethod which will fall back to structural type
checking if the instance is not an actual subclass. This can be controlled by the allow_implicit parameter which defaults to True.
The structural type-checking does not check function signatures.:
class Parrot(object):
def __init__(self):
self.height = 43
def speak(self, volume):
print('hello')
p = Parrot()
isinstance(p, IAnimal) --> False
IAnimal.provided_by(p) --> True
IAnimal.provided_by(p, allow_implicit=False) --> False
The structural type checking makes working with data transfer objects (DTO's) much easier.:
class IMyDataType(Interface):
thing: str
class DTO(object):
pass
d = DTO()
d.thing = 'hello'
IMyDataType.provided_by(d) --> True
e = DTO()
e.something_else = True
IMyDataType.provided_by(e) --> False
Adaption also supports structural typing by passing allow_implicit=True (but this is not the default):
speaker = ISpeaker.adapt(Parrot(), allow_implicit=True) ISpeaker.provided_by(speaker) --> True
When using provided_by() or adapt() with allow_implicit=True, a warning may be issued informing you that
the structurally typed object should inherit the interface. The warning is only issued if the interface is implemented by the
class (and not by instance attributes as in the DTO case above) and the warning is only issued once for each
class, interface pair. For example:
s = ISpeaker.adapt(Parrot()) UserWarning: Class Parrot implements ISpeaker. Consider inheriting ISpeaker or using ISpeaker.register(Parrot)
pure_interface provides a dataclass decorator. This decorator can be used to create a dataclass that implements an interface. For example:
class IAnimal2(Interface):
height: float
species: str
def speak(self):
pass
@dataclass
class Animal2(IAnimal2, object):
def speak(self):
print('Hello, I am a {} metre tall {}', self.height, self.species)
a = Animal2(height=4.5, species='Giraffe')
The builtin Python dataclass decorator cannot be used because it will not create attributes for the
height and species annotations on the interface base class IAnimal2.
As per the built-in dataclass decorator, only interface attributes defined
using annotation syntax are supported (and not the alternatives syntaxes provided by pure_interface).
The pure_interface module provides these functions for returning information about interface types.
- type_is_interface(cls)
- Return True if cls is a pure interface, False otherwise or if cls is not a class.
- get_type_interfaces(cls)
- Returns all interfaces in the cls mro including cls itself if it is an interface
- get_interface_names(cls)
- Returns a
frozensetof names (methods and attributes) defined by the interface. if interface is not aInterfacesubtype then an empty set is returned. - get_interface_method_names(interface)
- Returns a
frozensetof names of methods defined by the interface. if interface is not aInterfacesubtype then an empty set is returned - get_interface_attribute_names(interface)
- Returns a
frozensetof names of attributes defined by the interface. if interface is not aInterfacesubtype then an empty set is returned
The function decorator adapt_args adapts arguments to a decorated function to the types given.
For example:
@adapt_args(foo=IFoo, bar=IBar)
def my_func(foo, bar=None):
pass
In Python 3.5 and later the types can be taken from the argument annotations.:
@adapt_args
def my_func(foo: IFoo, bar: IBar=None):
pass
This would adapt the foo parameter to IFoo (with IFoo.optional_adapt(foo)) and bar to IBar
(using ``IBar.optional_adapt(bar))
before passing them to my_func. None values are never adapted, so my_func(foo, None) will work, otherwise
AdaptionError is raised if the parameter is not adaptable.
All arguments must be specified as keyword arguments:
@adapt_args(IFoo, IBar) # NOT ALLOWED
def other_func(foo, bar):
pass
Sometimes when adapting objects to an interface the adapter has to route attributes and methods to another object.
the Delegate class assists with this task reducing boiler plate code such as:
def method(self):
return self.impl.method()
The Delegate class provides 3 special attributes to route attributes to a child object. Only attributes and mothods
not defined on the class (or super-classes) are routed. (Attributes and methods defined on an interface sub-class are not
considered part of the implementation and these attributes are routed.)
Any one or combination of attributes is allowed.
pi_attr_delegates is a dictionary mapping delegate attribute names to either an interface or a list of attribute names.
If an interface is given then the list returned by get_interface_names() is used for the attribute names to route to the delegate object.
For example suppose we want to extend an Animal with a new method price:
class ExtendedAnimal(Delegate, IAnimal):
pi_attr_delegates = {'a': IAnimal}
def __init__(self, a):
self.a
def price(self):
return 'lots'
a = Animal(5)
ea = ExtendedAnimal(a)
ea.height -> 5 # height is in IAnimal and routed to 'ea.a.height'
ea.speak() -> 'hello' # speak is in IAnimal and routed to 'ea.a.speak()'
ea.price() -> 'lots'
The following code is equivalent but more verbose and won't update with changes to IAnimal:
class ExtendedAnimal(Delegate):
pi_attr_delegates = {'a': ['height', 'speak']}
def __init__(self, a):
self.a
...
The above works when the attribute names match. When they don't, you can use the pi_attr_mapping special attribute.
pi_attr_mapping takes the reverse approach, the key is the attribute and the value is a dotted name of how to route
the lookup. This provides a lot of flexibility as any number of dots are permitted.
This example is again equivalent to the first Delegate:
class ExtendedAnimal(Delegate):
pi_attr_mapping = {'height': 'a.height',
'talk': 'a.talk'}
def __init__(self, a):
self.a
def price(self):
return 'lots'
pi_attr_fallback, if not None, is treated a delegate for all attributes defined by base interfaces of the class
if there is no delegate, mapping or implementation for that attribute. Again, this is equivalent to the first Delegate.:
class ExtendedAnimal(Delegate, IAnimal):
pi_attr_fallback = 'a'
def __init__(self, a):
self.a
def price(self):
return 'lots'
Note that method and attribute names for all Interface classes in ExtendAnimal.mro() are routed to a.
Methods and properties defined on the delegate class itself take precedence (as one would expect):
class MyDelegate(Delegate, IFoo):
pi_attr_delegates = {'impl': IFoo}
def __init__(self, impl):
self.impl = impl
@property
def foo(self):
return self.impl.foo * 2
def bar(self, baz):
return 'my bar'
However, attempting to set an instance attribute as an override will just set the attribute on the underlying delegate instead. If you want to override an interface attribute using an instance attribute, first define it as a class attribute:
class MyDelegate(Delegate, IFoo):
pi_attr_delegates = {'impl': IFoo}
foo = None # prevents delegation of foo to `impl`
def __init__(self, impl):
self.impl = impl
self.foo = 3
- If you supply more than one delegation rule (e.g. both
pi_attr_mappingandpi_attr_fallack) then pi_attr_delegatesdelegates are created first and any attributes defined there are now part of the class.
Then pi_attr_mapping delegates are created (and become part of the class) and finally pi_attr_fallback is processed.
Thus if there are duplicate delegates defined, the one defined first takes precedence.
A special case where all delegated attributes are defined in an Interface is handled by the composed_type factory function.
composed_type takes 2 or more interfaces and returns a new type that inherits from all the interfaces with a
constructor that takes instances that implement those interfaces (in the same order). For exmaple:
AT = composed_type(IAnimal, ITalker) a = Animal(5) t = Talker() a_t = AT(a, t) a_t.height a_t.talk # AT(t, a) -> ValueError - arguments in wrong order.
If the same arguments are passed to composed_type again the same type is returned. For example:
AT = composed_type(IAnimal, ITalker) AT2 = composed_type(IAnimal, ITalker) AT is AT2 -> True
If the interfaces share method or attribute names, then the attribute is routed to the first encountered interface. For example:
class Speaker(ISpeaker, object):
def speak(self, volume):
return 'speaker speak'
SA = composed_type(ISpeaker, IAnimal)
s = Speaker()
a = Animal(5)
sa = SA(s, a)
sa.speak(3) -> 'speaker speak' # from s.speak
Types created with composed_type are Delegate subclasses with a provided_by method which returns True if the
argument provides all the interfaces in the type (even if the argument is not a Delegate subclasses).:
AT = composed_type(IAnimal, ITalker)
TA = composed_type(ITalker, IAnimal)
a_t = AT(Animal(5), Talker())
isinstance(a_t, AT) -> True
isinstance(a_t, TA) -> False
AT.provided_by(a_t) -> True
TA.provided_by(a_t) -> True
class X(IAnimal, ITalker):
...
AT.provided_by(X()) -> True
Much of the empty function and other checking is awesome whilst writing your code but
ultimately slows down production code.
For this reason the pure_interface module has an is_development switch with accessor functions.:
get_is_development() set_is_development(is_dev)
is_development defaults to True if running from source and default to False if bundled into an executable by
py2exe, cx_Freeze or similar tools.
If you call set_is_development to change this flag it must be set before modules using the Interface type
are imported or else the change will not have any effect.
If is_development if False then:
- Signatures of overriding methods are not checked
- No warnings are issued by the adaption functions
- No incomplete implementation warnings are issued
- The default value of
interface_onlyis set toFalse, so that interface wrappers are not created.
- InterfaceType(abc.ABCMeta)
Metaclass for checking interface and implementation classes. Adding
InterfaceTypeas a meta-class to a class will not make that class an interface, you need to inherit fromInterfaceclass to define an interface.In addition to the
registermethod provided byABCMeta, the following functions are defined onInterfaceTypeand can be accessed directly when theInterfacemethods are overridden for other purposes.- adapt (cls, obj, allow_implicit=False, interface_only=None)
- See
Interface.adaptfor a description. - adapt_or_none (cls, obj, allow_implicit=False, interface_only=None)
- See
Interface.adapt_or_nonefor a description - optional_adapt (cls, obj, allow_implicit=False, interface_only=None)
- See
Interface.optional_adaptfor a description - can_adapt (cls, obj, allow_implicit=False)
- See
Interface.can_adaptfor a description - filter_adapt (cls, objects, allow_implicit=False, interface_only=None)
- See
Interface.filter_adaptfor a description - interface_only (cls, implementation)
- See
Interface.interface_onlyfor a description - provided_by (cls, obj, allow_implicit=True)
- See
Interface.provided_byfor a description
Classes created with a metaclass of
InterfaceTypewill have the following property:- _pi Information about the class that is used by this meta-class. This attribute is reserved for use by
pure_interfaceand must not be overridden.
- Interface
Base class for defining interfaces. The following methods are provided:
- adapt (obj, allow_implicit=False, interface_only=None)
- Adapts
objto this interface. Ifallow_implicitisTruepermit structural adaptions. Ifinterface_onlyisNonethe it is set to the value ofis_development. Ifinterface_onlyresolves toTruea wrapper object that provides the properties and methods defined by the interface and nothing else is returned. RaisesAdaptionErrorif no adaption is possible or a registered adapter returns an object not providing this interface. - adapt_or_none (obj, allow_implicit=False, interface_only=None)
- As per adapt() except returns
Noneinstead of raising aAdaptionError - optional_adapt (obj, allow_implicit=False, interface_only=None)
- Adapts obj to this interface if it is not
NonereturningNoneotherwise. Short-cut foradapt(obj) if obj is not None else None - can_adapt (obj, allow_implicit=False)
- Returns
Trueifadapt(obj, allow_implicit)will succeed. Short-cut foradapt_or_none(obj) is not None - filter_adapt (objects, allow_implicit=False, interface_only=None)
- Generates adaptions of each item in objects that provide this interface. allow_implicit and interface_only are as for adapt. Objects that cannot be adapted to this interface are silently skipped.
- interface_only (implementation)
- Returns a wrapper around implementation that provides the properties and methods defined by the interface and nothing else.
- provided_by (obj, allow_implicit=True)
- Returns
Trueif obj provides this interface. Ifallow_implicitisTruethe also returnTruefor objects that provide the interface structure but do not inherit from it. RaisesInterfaceErrorif the class is a concrete type.
- Delegate
Helper class for delegating attribute access to one or more objects. Attribute delegation is defined by using one or more special call attributes
pi_attr_delegates,pi_attr_mappingorpi_attr_fallback.- pi_attr_delegates
A dictionary mapping implementation attribute to either a list of attributes to delegate to that implementation, or an
Interfacesubclass. If anInterfacesubclass is specifed the names returned byget_interface_namesare used instead. For example:pi_attr_delegates = {'_impl': ['foo', 'bar']}creates implmentations of
obj.fooasobj._impl.fooandobj.barasobj._impl.bar.- pi_attr_mapping
A dictionary mapping attribute name to dotted lookup path. Use this if the exposed attribute does not match the attribute name on the delegatee or if multiple levels of indirection are requried. For example:
pi_attr_mapping = {'foo': '_impl.x', 'bar': '_impl.z.y'}creates implmentations of
obj.fooasobj._impl.xandobj.barasobj._impl.z.y.- pi_attr_fallback
When a delegate class implements an interface (or interfaces),
pi_attr_fallbackmay be used to specify the name the implementation attribute for all attributes not otherwise defined on the class or by the methods above. For example:class MyDelgate(Delegate, IAnimal): pi_attr_fallback = 'impl' def __init__(self, animal): self.impl = animalIf the delegate does not inherit from an interface then
pi_attr_fallbackdoes nothing.- provided_by (obj)
Interface.provided_byequivalent for delegates created bycomposed_type. It returnsTrueif obj provides all the interfaces in the composed type andFalseotherwise.
- adapts (from_type, to_interface=None)
- Class or function decorator for declaring an adapter from from_type to to_interface.
The class or function being decorated must take a single argument (an instance of from_type) and
provide (or return and object providing) to_interface. The adapter may return an object that provides
the interface structurally only, however
adaptmust be called withallow_implicit=Truefor this to work. If decorating a class, to_interface may beNoneto use the first interface in the class's MRO. - register_adapter (adapter, from_type, to_interface)
- Registers an adapter to convert instances of from_type to objects that provide to_interface for the to_interface.adapt() method. adapter must be a callable that takes a single argument (an instance of from_type) and returns and object providing to_interface.
- type_is_interface (cls)
- Return
Trueif cls is a pure interface andFalseotherwise - get_type_interfaces (cls)
- Returns all interfaces in the cls mro including cls itself if it is an interface
- get_interface_names (cls)
- Returns a
frozensetof names (methods and attributes) defined by the interface. if interface is not aInterfacesubtype then an empty set is returned. - get_interface_method_names (cls)
- Returns a
frozensetof names of methods defined by the interface. If cls is not aInterfacesubtype then an empty set is returned. - get_interface_attribute_names (cls)
- Returns a
frozensetof names of class attributes and annotations defined by the interface If cls is not aInterfacesubtype then an empty set is returned. - dataclass (...)
- This function is a re-implementation of the standard Python
dataclasses.dataclassdecorator. In addition to the fields on the decorated class, all annotations on interface base classes are added as fields. See the Python dataclasses documentation for details on the arguments, they are exactly the same. - get_is_development()
- Returns the current value of the "is development" flag.
- set_is_devlopment (is_dev)
Set to
Trueto enable all checks and warnings. If set toFalsethen:- Signatures of overriding methods are not checked
- No warnings are issued by the adaption functions
- No incomplete implementation warnings are issued
- The default value of
interface_onlyis set toFalse, so that interface wrappers are not created.
- get_missing_method_warnings ()
- The list of warning messages for concrete classes with missing interface (abstract) method overrides. Note that missing properties are NOT checked for as they may be provided by instance attributes.
- composed_type (*interface_types)
- Type factory function that creates a
Delegatesubclass that implements all the interfaces via delegates.
- PureInterfaceError
- Base exception class for all exceptions raised by
pure_interface. - InterfaceError
- Exception raised for problems with interfaces
- AdaptionError
- Exception raised for problems with adapters or adapting.
| [*] | We don't talk about the methods on the base Interface class. In earlier versions they
were all on the meta class but then practicality got in the way. |