[Twisted-Python] Interfaces and adapters
en.karpachov at ospaz.ru
en.karpachov at ospaz.ru
Fri Aug 26 02:17:07 EDT 2005
Let's say we defined an interface and an adapter:
class IFoo(zope.interfaces.Interface):
pass
twisted.python.components.registerAdapter(Foo, Bar, IFoo)
As it is for now, the registerAdapter accepts any Foo, without regarding
what it implements.
Could somebody give any rationale why this condition shouldn't always hold:
foo = IFoo(bar)
assert IFoo.providedBy(foo)
Seems it is not unreasonable to expect this behaviour, because it is
exactly what interfaces are all about, or am I wrong?
--
jk
More information about the Twisted-Python
mailing list