In article <[EMAIL PROTECTED]>,
Toby Dickenson <[EMAIL PROTECTED]> wrote:
>On Fri, 19 Apr 2002 15:28:52 + (UTC), [EMAIL PROTECTED] ()
>wrote:
>
>>It seems there is no way to get the real 'b' attribute from a, i.e. the
>>B instance set at the line "a.b = B()"
>
>Thats exactly right. your __of_
On Fri, 19 Apr 2002 15:28:52 + (UTC), [EMAIL PROTECTED] ()
wrote:
>It seems there is no way to get the real 'b' attribute from a, i.e. the
>B instance set at the line "a.b = B()"
Thats exactly right. your __of__ method means that *any* time you try
to take a B object out of an A, you get a C
Here is a simple code:
from Acquisition import Implicit, aq_base
class A(Implicit): pass
class C(Implicit): pass
class B(Implicit):
def __of__(self, parent):
# controls the wrapper used for acquisition
c = C()
c._parent = parent
return c.__of__(parent)