Zope implements acquisition with "Extension Class" mix-in classes. To use acquisition your classes must inherit from an acquisition base class. For example:
>>> import ExtensionClass, Acquisition
>>> class C(ExtensionClass.Base):
>>> class A(Acquisition.Implicit):
... def report(self):
... print self.color
>>> a = A()
>>> c = C()
>>> c.a = a
>>> d = C()
>>> d.color = 'green'
>>> d.a = a
>>> a.report() # raises an attribute error
Traceback (most recent call last):
The class A inherits acquisition behavior from Acquisition.Implicit. The object, a, "has" the color of objects c and d when it is accessed through them, but it has no color by itself. The object a obtains attributes from its environment, where its environment is defined by the access path used to reach a.
- Raise RuntimeError: Recursion detected in acquisition wrapper if an object with a __parent__ pointer points to a wrapper that in turn points to the original object.
- Prevent wrappers to be created while accessing __parent__ on types derived from Explicit or Implicit base classes.