Ross Boylan writes:
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)
I started to use the following idiom:
class
From: Adrian Hungate [EMAIL PROTECTED]
Erm... that trashes the concept of mixin's, doesn't it?
No, why would it? Just make your mixins inherit Extentionclass.base!
If you have third-party mixins that aren't made for Zope from the beginning
and need initailization, then you probably have to
Ross Boylan wrote:
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 normal Python inheritted attribute lookup rules: depth first, left to
I had the bright idea of defining a mixin class whose methods I
thought I could use in my regular Zope product classes:
class AMixin:
def __init__(self):
blah, blah blah
class B(AMixin, Persistent, Folder, ):
def __init__(self):
# do some of my own stuff
: Monday, July 22, 2002 3:30 AM
Subject: [Zope-dev] Extension class and __init__
I had the bright idea of defining a mixin class whose methods I
thought I could use in my regular Zope product classes:
class AMixin:
def __init__(self):
blah, blah blah
class B(AMixin, Persistent, Folder