[Zope] m_self of methods accessed via non trivial acquisition

Stefan Bund sbund@artec-berlin.com
Thu, 17 Jan 2002 10:41:12 +0100


My question regards the details of how the contents of m_self of an
acquired method is calculated by the acquisition machinery.

To illustrate this, I will depict an acquisition tree using the
following symbols:

  O                    -- an acquisition wrapper
  <upcase letter>      -- an acquitsition wrapper named for further reference
  [<lowercase letter>] -- an object
  --                   -- the aq_parent link
  |                    -- the aq_self link


I will use the following acquisition tree for illustration (it
resembles the tree I have in my application, I just reduced it to
make my point)

A--O--[a]
|  |
|  [b]
|
O--B--O--[c]
|  |  |
|  |  [d]
|  |
|  O--[e]
|  |
|  [f]
|
[g]

In this representation, the acquisition order is from bottom to top.
The bottom most object is /A.aq_base/. Acquisition along containment
only produces horizontal lines of acquisition wrappers.

let /m/ be a method of the objekt /f/. The expression of interest is

    x := A.m

I would expect /x.m_self/ to be an acquisition wrapper C

    C := A.f

where (as far as i understand the rules of acquisition) 
/C.aq_parent == A/

But instead displaying  /x.m_self/ yields the acquisition tree rooted
at /B/ !!

I find this a bit disturbing. My question: 'Is it a *bug* or a
*feature*?'. I hope, I made my point clear.

I hope someone can shed light on this subject,

Stefan.