[Zope-dev] override __of__

Chris McDonough chrism@zope.com
06 Feb 2003 16:33:29 -0500


Is this what you're trying to do?

Starting debugger
   /home/chrism/projects/TIProject/bin/python -i -c "import user;import
Zope;app=Zope.app()" 

>>> from Acquisition import Implicit
>>> class Foo(Implicit):
...     def __of__(self, parent):
...         return Implicit.__of__(self, parent)
... 
>>> f = Foo()
>>> g = Foo()
>>> f.__of__(g)
<Foo instance at 8ad6940>


On Thu, 2003-02-06 at 16:16, Tim McLaughlin wrote:
> Is there any way to override __of__ on an object?  I've tried it but for 
> whatever reason, Implicit.__of__(self, object) says that self is not an 
> Acquirer even though the object is a subclass of Implicit.  I would 
> implement in a traverse hook, but attribute access of that object won't 
> do traversal. :(
> 
> Cheers,
> Tim
> 
> -- 
> Tim McLaughlin
> Chief Technology Officer
> Siteworx, Inc... Set your site on the future!
> 703.390.5421