[Zope-dev] zope.component: calling an Interface and calling queryAdapter give differing results
Chris Withers
chris at simplistix.co.uk
Fri Aug 22 10:07:43 EDT 2008
Shane Hathaway wrote:
>> It sure would be nice if it had a docstring that at least indicated that
>> was its only intended purpose.
>
> Now would be a good time for you to add that docstring to the trunk. :-)
Yes well, I apparently don't have enough knowledge to do this correctly.
Maybe someone with that knowledge could do so?
>> From a use point of view, I'd only expect queryAdapter to consider
>> looking for a named adapter if I actually provide a name. If I provide
>> no name, it would seem logical to look up a non-named adapter. If
>> looking up a non-named adapter, it would make sense if the object
>> already provides the desired interfaces to just return the object.
>>
>> I'd love to see where this expectation is faulty...
>
> I'm switching to Jim's side now. :-) The semantics you described are
> more magical.
How so? I've given a very concise explanation of *why* it's not
surprising for users for it to work the way I describe. The yway it
currently works makes people except those involved in the development of
the package go "wait, that's not what I expected to have happen, huh?"
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
More information about the Zope-Dev
mailing list