main logo
Subject: Re: [dabo-users] [part 2] a Simple tutorial on bizObjects`
Author: Ed Leafe
Posted: 2007/12/31 22:49:40
 
View Entire Thread
New Search


On Dec 31, 2007, at 8:53 PM, bsnipes wrote:

> Where can I find info on the super() method? Does this call an a
> method in
> a base class?

It's a somewhat magical shortcut Paul cooked up for calling the
superclass behavior for a method. It's in dabo.lib.autosuper, and is
one of the mixin classes for dObject. So if your class is Foo, and
based on dabo.Bar, the following are all equivalent:

def method(self):
dabo.Bar.method(self)

def method(self):
super(dabo.Bar, self).method()

def method(self):
self.super()

I prefer the second form, since it and the last work better with
subclasses based on multiple inheritance, and the last form is just a
little too fragile-feeling for me. However, it does seem to work
well, so it's just a matter of taste.

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com





 
©2007 Ed Leafe
<-- Prior Message New Search Next Message -->