[Zope3-Users] Re: Checking if an interface is provided by an object or could be adapted to

Bernd Dorn zope-mailinglist at mopa.at
Mon May 1 02:56:44 EDT 2006


On 01.05.2006, at 01:55, Stephan Richter wrote:

> On Sunday 30 April 2006 19:34, Bernd Dorn wrote:
>> component.queryMultiAdapter((bar,baz), IFoo) is not None or False

this way you always get True or False

ok, for this case it is ok

but when you have a class that  uses __conform__ None may be returned  
when you use this

IFoo(context,False)

or am i wrong?

>
> Why not just:
>
> component.queryMultiAdapter((bar,baz), IFoo, default=False)
>
> Regards,
> Stephan
> -- 
> Stephan Richter
> CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
> Web2k - Web Software Design, Development and Training



More information about the Zope3-users mailing list