[Zope] Acquisition on dynamically created objects

Jim Fulton jim@digicool.com
Mon, 17 Jan 2000 08:42:45 -0500


Brian Lloyd wrote:
> 
(snip)
> The Acquisition base classes
> (such as Acquisition.Implicit) override getattr() handling
> and automatically handle the wrapping of the resulting object
> when an attribute is accessed via getattr().

<note>
This isn't quite right. ExtensionClass checks for an '__of__'
method on a sub-object retrieved through an attribute access.
The '__of__' method, is defined for the sub-object, is called
to obtain the sub-object in the context of the container.
Acquisition.Implicit defined '__of__', not '__getattr__'.
The '__of__' protocol is *also* used for things like user-defined
method types and computed attributes.
</note>

Jim

--
Jim Fulton           mailto:jim@digicool.com   Python Powered!        
Technical Director   (888) 344-4332            http://www.python.org  
Digital Creations    http://www.digicool.com   http://www.zope.org    

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.