[Zope-dev] Aquisition, in, == and is

Chris Withers chrisw@nipltd.com
Wed, 12 Jul 2000 13:32:32 +0100


Chris Withers wrote:
> Steve Alexander wrote:
> > > Do you know if objects in PARENTS are acquisition wrapped?
> > I'm pretty sure that they are.
> 
> They are indeed, in fact, pretty much everything is :(
> The only way to check if o is in PARENTS appears to be:

> if o.aq_base in map (lambda o : o.aq_base,PARENTS):

Hmm, is there anyway the Acquisition ExtensionClass(right thing? I'm not
too hot here ;-) could be altered such that, if r1 and r2 are two
different acquisition wrappers for the same object that:

r1 == r2 and r1 in [r2,x,y]

would return true?

It might be best to leave (r1 is r2) returning false as it does now so
that you can actually tell if things aren't what you expected ;-)

Any ideas?

cheers,

Chris

PS: This question is still worrying me :(

> 2. Is there any case where a Zope object isn't going to have a .aq_base
>    attribute?