[Zope] aq_inner and acquisition by containment only

Stefan Bund l-zope.z.xalan at xoxy.net
Wed May 12 17:31:18 EDT 2004


Dieter Maurer <dieter at handshake.de> writes:
> Sure, because "aq_self" ("b") is not a wrapper.
> This is the criterion for an "aq_inner" object.

I know. At least, I think, I understand your statement. 

I know, that aq_inner is the wrapper directly above aq_base, or in
other words the last wrapper found following the aq_self links of the
tree. 

My problem is, *why* is aq_self not a wrapper? I know, how this
happens, I can reproduce it using the acquisition algebra and the
simplification rule, but that's my point: aq_inner does *not* always
produce an object wrapped by containment *only* which I always thought
to be the case. Thats at least, how it is documented. Citing from the
Zope Developer's Guide
(http://zope.org/Documentation/Books/ZDG/current/Acquisition.stx):

   You can use the special method aq_inner to access an object wrapped
   only by containment.

What I tried to make clear in my post was, that *before* graphing the
acquisition tree, I would have expected aq_inner to return the simple
tree 'b o ( a o x )' (which would be acquisition by containment
only). After I saw the tree, it was clear, why this is not the
case. What bothers me is, that the full acquisition chain of
'x.a.c.a.b.aq_inner' includes 'c' which is *not* in b's containment
context (is there an 'official' name for the list of *all* objects
visited during an acquisition lookup as aq_chain is only the parent
chain ... I always call this concept aq_order).

I hope, my question/problem is clear now?

-- 
-- *DON'T* TRY TO REACH ME DIRECTLY AT ABOVE EMAIL ADDRESS. Any reply
-- received off-list at that address will be *silently* and
-- *unconditionally* dropped. You can attribute this inconvenience to
-- the proliferation of spammers on the Internet. I hope, you can
-- understand my position and accept my counter measures.



More information about the Zope mailing list