[Zope-dev] inheritedAttribute

Steve Alexander steve@cat-box.net
Mon, 28 Aug 2000 09:58:18 +0100


In the latest Zope source, I've noticed calls to inheritedAttribute in
the Python code.

I've found the C source code in ExtensionClass.c, but it doesn't help me
understand when I should use it from Python, and why.


*reads more source*

Ah! About 70 lines further on in ExtensionClass.c:

   "inheritedAttribute(class,name) -- Get an inherited attribute\n\n"
   "Get an attribute that would be inherited if the given (extension)\n"
   "class did not define it.  This method is used when overriding\n"
   "inherited methods.  It provides 2 advantages over accessing\n"
   "\n"
   "attributes directly through a superclass:\n"
   "\n"
   "1. The superclass need not be known,\n"
   "\n"
   "2. The superclass may be a Python class.  Without this method, it
would\n"
   "   be possible to override methods inherited from python classes
because\n"
   "   unbound methods gotten from Python classes cannot be called with
\n"
   "   extension class instances.  \n"


Is there some documentation of this on zope.org or dev.zope.org that
I've missed?

Thanks.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net