[Tutor] super.__init__() arguments

Jojo Mwebaze jojo.mwebaze at gmail.com
Mon Sep 27 01:45:54 CEST 2010


Hey Tutor,

Seems a small issue but this has been playing for a while now, what am i
doing wrong here?

Take an Example

Class Point:
   def __init__(self, x=0, y=0):
     self.x = x
     self.y = y

Class Circle(Point):
    def __init__(self, radius=0, x=0, y=0):
        super().__init__(x, y)
        self.radius = radius


c = Circle(radius =3, x=4, y= 6)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "Point.py", line 13, in __init__
    super().__init__(x, y)
TypeError: super() takes at least 1 argument (0 given)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100927/cf112e36/attachment.html>


More information about the Tutor mailing list