Ed Leafe wrote:

> On Apr 20, 2013, at 7:01 AM, Sibylle Koczian
> <[email protected]> wrote: 
> 
>> I suppose I got this from some example code, but I don't remember
>> where. At all events: what's the class "self" refers to?
>> dCheckList? dPanel? Something else? If I try to solve such
>> questions from the .cdxml, what should I search for? 
> 
>      The first argument to super() is always the class of the
>      instance running that code. You can always get that by using
>      `self.__class__`, which I would suggest for use inside a
>      .cdxml, where the class name is generated at runtime. 

        That's actually not quite right.  The first argument to super() has 
to be the class whose implementation of the method is currently being 
run (i.e., the class whose implementation is calling super).  This is 
not always the same as the class of the instance.  If A uses super to 
call B's implementation of a method, and B tries to use 
super(self.__class__, self), then self.__class__ will still be A, and 
infinite recursion will result.  See 
http://stackoverflow.com/questions/4235078/how-to-avoid-infinite-
recursion-with-super .

-- 
Brendan Barnwell
"Do not follow where the path may lead.  Go, instead, where there is no 
path, and leave a trail."
   --author unknown

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to