[SciPy-user] strange,frustrating error

Ryan Krauss ryanlists at gmail.com
Wed Feb 8 15:42:59 CST 2006


I am getting an error that is driving me crazy on code that used to
work.  And the really weird thing is that if I use the debugger to set
a trace just before the error and step into the specific line that was
causing the error, the code executes correctly.  But if I just try to
step over the line (debugger n vs. debugger s commands), I get the
error.

Here is the error message:
/home/ryan/thesis/feedback_modeling/experiments/samii_model.py in
__init__(self, beamparams, maxsize, symname, symlabel, symsub, usez)
     44 class samiiBeam(TMM.beam.BeamElement):
     45     def
__init__(self,beamparams={'EI':339134.5276,'mu':5.7281,'L':4.6482},maxsize=ms,symname='Ubeam',symlabel='beam',symsub=True,usez=True):
---> 46         return
TMM.beam.BeamElement.__init__(self,beamparams,maxsize=maxsize,symlabel=symlabel,symname=symname,symsub=symsub,usez=usez)
     47
     48 class samiiLink0(TMM.rigid.RigidMass):

TypeError: unbound method __init__() must be called with BeamElement
instance as first argument (got samiiBeam instance instead)
WARNING: Failure executing file: <summary_report.py>

Basically, I have a derived class trying to call its super-class (or
parent class) constructor and getting the error that it isn't an
instance of its own super-class.  The super-class is defined in
another module and imported (I used to import it with a from
statement, but that wasn't working either today).

I call this constructor at another place in the code:
67     beam=samiiBeam()

and that is the line that generates an error if I just hit n in the
debugger, but executes correctly if I step into it and exectute the
__init__ method step-by-step.

Any help,

Ryan



More information about the SciPy-user mailing list