Marius Gedminas wrote:
Now when you try to adapt anything to ITest, zope.component will call
your ``adapter`` function and then check the return value. A return
value of None means "the adapter is not available", and results in a
TypeError you see here:
Yes, apologies, both you and Philipp are correct, I was trying to show a
simple version of a problem and oversimplified.
Here's what I really meant:
>>> from zope.component import provideAdapter
>>> from zope.interface import Interface
>>> from zope.component import getMultiAdapter
>>> class ITest(Interface): pass
>>> def adapter(*args): return args
Yay, as expected...
Good, still works...
Traceback (most recent call last):
((1, 1), <InterfaceClass __main__.ITest>, u'')
Oh dear, what have I done wrong here?
Simplistix - Content Management, Zope & Python Consulting
Zope3-dev mailing list