[Zope-dev] __getattr__ and Acquisition
Dieter Maurer
dieter@handshake.de
Tue, 24 Sep 2002 21:32:01 +0200
Andreas Kostyrka writes:
> ...
> > __of__ is non-intuitive but it can work.
> So how do I call it?
> return myitem.__of__(self)
> Doesn't make sense, as self is not wrapped and as such DOES not contain
> any knowledge how it was accessed, ...
Acquisition lookup is implemented by a recursive function:
While you are right that "self" does not know how it was accessed,
the recursive lookup function does (on its runtime stack).
And it will provide the missing context when it builds further
wrappers on returning from the recursive calls.
Dieter