[Zope-dev] Extension class and __init__

Ross Boylan RossBoylan@stanfordalumni.org
Fri, 26 Jul 2002 10:28:31 -0700


On Mon, Jul 22, 2002 at 08:52:27AM -0400, Chris McDonough wrote:
> Ross,
> 
> Please see the bit about "inheritedAttribute" in the document inside
> Zope's source tree named
> lib/Components/ExtensionClass/doc/ExtensionClass.html.
> 
> HTH,
> 
> - C
> 

The trick given there doesn't seem to work in complicated cases.

The example there is basically
class Spam:
  def __init__(self):
    ...

class ECSpam(Base, Spam):  #Base is an ExtensionClass
  def __init__(self):
    ECSpam.inheritedAttribute('__init__')(self)


What if you have more than one base class with the method defined?
The implication of th example is that the non-extension class base
class is used (though even that is not clear; would this work if Base
had __init__?), but what if there are several non-extension base
classes?

The syntax doesn't provide a way of indicating which class you want
the method from, and so it seems incomplete.