Inheritance problem?

KraftDiner bobrien18 at yahoo.com
Thu Jan 5 22:18:54 EST 2006


I have a class

class MyClass(MyBaseClass)
   def __init__(self)
      super(self.__class__, self).__init__()
      self.type = MyClassType
      return self

It has a few methods...
I have another class and the only difference is the __init__ method..

I tried this:
class MySpecialClass(MyClass)
   def __init__(self)
      super(self.__class__, self).__init__()
      self.type = MySpecialClassType       # This is the only line
that's different between the two classes.
      return self

At runtime I get an error:
RuntimeError: maximum recursion depth exceeded
What have I done wrong?




More information about the Python-list mailing list