'Learning Python' by Lutz and Ascher (excellent book by the way)
explains that a subclass can call its superclass constructor as
follows:
class Super:
def method(self):
# do stuff
class Extender(Super):
def method(self):
Super.method(self) # call the method in super
# do more
[EMAIL PROTECTED] wrote:
'Learning Python' by Lutz and Ascher (excellent book by the way)
explains that a subclass can call its superclass constructor as
follows:
(snip)
Now, this is fine using the above code. Where I'm struggling is with
argument passing. The following, for example,
On Wed, Jul 26, 2006 at 09:21:10AM -0700, [EMAIL PROTECTED] wrote:
'Learning Python' by Lutz and Ascher (excellent book by the way)
explains that a subclass can call its superclass constructor as
follows:
class Super:
def method(self):
# do stuff
class Extender(Super):
def
[EMAIL PROTECTED] wrote:
'Learning Python' by Lutz and Ascher (excellent book by the way)
explains that a subclass can call its superclass constructor as
follows:
class Super:
def method(self):
# do stuff
class Extender(Super):
def method(self):
Super.method(self) # call
class S:
def __init__(self, **k): self.data = k
class E(S):
def __init__(self, **k):
S.__init__(self, **k)
x = E(a=1)
print x.data
{'a': 1}
From: [EMAIL PROTECTED]
To: python-list@python.org
Subject: extender method
Date: 26 Jul 2006 09:21:10
Chris Lambacher [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Wed, Jul 26, 2006 at 09:21:10AM -0700, [EMAIL PROTECTED] wrote:
'Learning Python' by Lutz and Ascher (excellent book by the way)
explains that a subclass can call its superclass constructor as
follows:
class