Simulate tales function namespaces with adapter lookup.

When we are asked for a namespace, we return an object that actually computes an adapter when called:

To demonstrate this, we need to register an adapter:

>>> from import setUp, tearDown
>>> setUp()
>>> from import ztapi
>>> def adapter1(ob):
...     return 1
>>> ztapi.provideAdapter(None, IPathAdapter, adapter1, 'a1')

Now, with this adapter in place, we can try out the namespaces:

>>> ob = object()
>>> namespaces = AdapterNamespaces()
>>> namespace = namespaces['a1']
>>> namespace(ob)
>>> namespace = namespaces['a2']
>>> namespace(ob)
Traceback (most recent call last):
KeyError: 'a2'


>>> tearDown()

Base classes

Implemented Interfaces

There are no implemented interfaces.


There are no attributes in this class.


There are no methods in this class.

Known Subclasses

There are no known subclasses.