[Zope3-dev] Re: calling interface returns object, calling queryAdapter returns None?

Jim Fulton jim at zope.com
Thu Jan 25 09:11:12 EST 2007


On Jan 24, 2007, at 8:44 PM, Tres Seaver wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Chris Withers wrote:
>> Fred Drake wrote:
>>> On 1/24/07, Chris Withers <chris at simplistix.co.uk> wrote:
>>>> queryAdapter, for me, is "starting with the supplied object, get me
>>>> something that implements the supplied interface and return None  
>>>> if no
>>>> such object can be obtained".
>>>  o = IFoo(ob, None)
>>>  if os is not None:
>>
>> Ah, now that's what I was looking for, thanks :-)
>
> Note that for regularity, I assert that the calling the IFoo interface
> should allow the follwing use cases, based on the asserition that
> utilities are "zero-order" adapters, just as views are "binary order"
> adapters.

I disagree with this assertion for the reason that Marius stated,  
which is that adapters are factories and utilities are not.  I  
certainly understand why you would make that assertion.

Jim

--
Jim Fulton			mailto:jim at zope.com		Python Powered!
CTO 				(540) 361-1714			http://www.python.org
Zope Corporation	http://www.zope.com		http://www.zope.org





More information about the Zope3-dev mailing list