Andreas Kostyrka writes:
 > I've just discovered, that Acquisition does not work with __getattr__,
 > right?
It does, just not the way, you expect it:

  The actual attribute lookup (for attributes not starting with
  "aq_") is always made with an unwrapped object.
  That's the reason why the "self" in "getattr" is unwrapped.

  Special operations ensure for Python Methods (the one of
  "ExtensionClass" not Zope's!) that their "self" receives part
  of the acquisition context (it's rarely the full context,
  just enough to work in most cases).
  They are rebuild with the current node as "self", when the recursive lookup
  comes back out of "aq_self" iff the method's "self" is "aq_self".

You may have a look at my "Reference" product

  <http://www.dieter.handshake.de/pyprojects/zope>

There, I fight with the peculiarities of "__getattr__" and
acquisition context for methods.


Dieter

_______________________________________________
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 )

Reply via email to