Re: inheritance problem with 2 cooperative methods

2004-12-03 Thread Dan Perl
This is almost the same code as Greg's with the only difference being that test for configuration having been done. But the test is unnecessary. I don't see how setConfig could be invoked in the super of the base class (A), so such a test would be relevant only in subclasses, if they DO invoke

Re: inheritance problem with 2 cooperative methods

2004-12-03 Thread David Fraser
Dan Perl wrote: Here is a problem I am having trouble with and I hope someone in this group will suggest a solution. First, some code that works. 3 classes that are derived from each other (A->B->C), each one implementing only 2 methods, __init__ and setConfig.

Re: inheritance problem with 2 cooperative methods

2004-12-02 Thread Dan Perl
Thank you very much, Greg, that does the job! Somehow I couldn't see it and I needed someone to point out to me. Dan "Greg Ewing" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dan Perl wrote: >> So far, so good! But let's assume that I want to change the __init__ >> methods s

Re: inheritance problem with 2 cooperative methods

2004-12-02 Thread Greg Ewing
Dan Perl wrote: So far, so good! But let's assume that I want to change the __init__ methods so that they take a configuration as an argument so the objects are created and configured in one step, like this: alpha = A(config) One way would be to make the setConfig call only in the root class, an

inheritance problem with 2 cooperative methods

2004-12-02 Thread Dan Perl
Here is a problem I am having trouble with and I hope someone in this group will suggest a solution. First, some code that works. 3 classes that are derived from each other (A->B->C), each one implementing only 2 methods, __init__ and setConfig.