Chris Withers wrote at 2008-8-19 18:30 +0100:
> >>> class ISomething(Interface): pass
> >>> class MyClass: implements(ISomething)
> >>> m = MyClass()
>Right, so this does make sense:
> >>> ISomething(m)
><__main__.MyClass instance at 0x00BED6E8>
>This does not:
> >>> repr(queryAdapter(m,ISomething))
>why the difference?
Jim is heavily defending this difference.
I am convinced that the difference should not be there
but meanwhile have found a use case for it.
Suppose, you have a class "C" that implements "I".
If "queryAdapter" would behave like "I(...)", you
would have no way to override the implementation
of "I" by "C".
With the current behavior, you can use
"queryAdapter(c, I)" to check whether some special
requirements apply and in this case use the special purpose
Not that this use case had been able to convince me that
the difference were justified.
Zope-Dev maillist - Zope-Dev@zope.org
** No cross posts or HTML encoding! **
(Related lists -