# Re: [Zope-dev] Acquisition Confusion :S

```From: Chris Withers <[EMAIL PROTECTED]>

> I still don't get this :(

Here are the two and a half rules for deriving acquisition from a dotted
expression:

1.  A.B == (B o A), where A is an unwrapped object

2.  (self o parent).B ==
a. (self.B o (self o parent)), if B is found in 'self'
b. (parent.B o (self o parent)), if B is found in 'parent'

> A has attributes B and C, C has attribute D
>
> A.B.C.D = (B o A) : .C.D
by rule 1

>         now, since C is found in A:
>
>         = ((C o A) o (B o A)) : .D
by rule 2b, then rule 1

= ((C o A).D o ((C o A) o (B o A))) by rule 2a
= ((C.D o (C o A)) o ((C o A) o (B o A))) by rule 2a
= (((D o C) o (C o A)) o ((C o A) o (B o A))) by rule 1

and then simplification, applied upwards, gives:

= ((D o (C o A)) o ((C o A) o (B o A)))
= (D o ((C o A) o (B o A)))

> > In this case aq_inner is the entire
> > expression, since aq_self is not a wrapper.
>
> I still don't get this at all :(

If A==(self o parent), then
If self is an unwrapped object, then aq_inner(A) == A
else aq_inner(A) == aq_inner(self)

In other words, aq_inner is the left-inner-most wrapper.  Find the leftmost
'o' in the expression, and you've got it.

Cheers,

Evan @ digicool & 4-am

_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope )

```