Hello gurus,<br>
<br>
Python n00b here trying to learn some OOP-Python.Here's my problem.<br>
<br>
I have 3 modules which have class declarations in them and which implement multiple inheritance.<br>
<br>
Module1<br>
--------<br>
class OptionClass:<br>
    def __init__ (self,name,ORSpecNumber,AltToItselfStart,AltToItselfEnd) :<br>
        self.Name = name<br>
        self.ORSpecNumber = ORSpecNumber<br>
        self.AltToItselfStart = AltToItselfStart<br>
        self.AltToItselfEnd = AltToItselfEnd<br>
class Warning:<br>
    def __init__(self,Warn_number,Warn_name,Warn_type,Warn_text) :<br>
        self.Warn_name = Warn_name<br>
        self.Warn_number = Warn_number<br>
        self.Warn_type = Warn_type<br>
        self.Warn_text = Warn_text<br>
    def Fire(self) :<br>
        common_subs.write_to_out_file('FOO_OUT',self.Warn_text)<br>
<br>
class characterestic:<br>
    def __init__(self,char_name,char_type,char_value) :<br>
        self.Char_name = char_name<br>
        self.Char_type = char_type<br>
        self.Char_value = char_value<br>
<br>
In Module2 I have a class which derives from OptionClass of Module1.<br>
<br>
Module2<br>
------------<br>
import Module1<br>
<br>
class Option1(Module1.OptionClass):<br>
    def __init__(self) :<br>
        Module1.OptionClass.__init__('Blah Blah','OR0001','0000','0000')<br>
    option_char = Module1.characterestic('strOperationalWeightsTemplate','int',1000)<br>
<br>
Module3 has a Class which Derives from the Class defined in Module2.<br>
<br>
Module3<br>
------------<br>
import Module1<br>
import Module2<br>
<br>
class Option1_Rule1(declaration.Option1):<br>
    def __init__(self) :<br>
         Module2.Option1.__init__(self)<br>
    Option1_warning = Module1.Warning(1,'This is a
warning name','Compatibility','Blah Blah,warning text which gets
printed')<br>
    def Option1_constraint(self):<br>
        if isinstance(self,Module2.Option1):<br>
            print 'condition satisfied'<br>
            self.FOO_warning.Fire()<br>
        else :<br>
            pass<br>
<br>
Finally I have a simple script which does the instantiation of the Class defined in Module3.<br>
<br>
Script<br>
-----<br>
import Module3<br>
<br>
Test_Case = Module3.Option1_Rule1()<br>
Test_Case.Option1_constraint()<br>
<br>
Problem is when I run the above script it throws out the following error.<br>
<br>
Traceback (most recent call last):<br>
  File "E:\PyPBM\PyPBM\test_case.py", line 7, in ?<br>
    TH = constraint.Option1_Rule1()<br>
  File "E:\PyPBM\PyPBM\constraint.py", line 13, in __init__<br>
    declaration.Option1.__init__(self)<br>
TypeError: __init__() takes no arguments (1 given)<br>
<br>
in the above errors:<br>
test_case is the above script.<br>
constraint => Module3<br>
declaration => Module2<br>
superclass => Module1<br>
<br>
Help required.<br>
<br>
Thanks,<br>
Toufeeq<br>
-- <br>Get Firefox:<a href="http://www.mozilla.org/products/firefox/">http://www.mozilla.org/products/firefox/</a><br>The fastest, safest and best Browser !!<br>