[Tutor] super.__init__() arguments

Jojo Mwebaze jojo.mwebaze at gmail.com
Mon Sep 27 16:56:04 CEST 2010


Thanks Guys! Works perfect....

cheers



On Mon, Sep 27, 2010 at 1:01 PM, Wayne Werner <waynejwerner at gmail.com>wrote:

> In addition it only works for new style classes.
>
> -wayne
>
> On 9/27/10, Lie Ryan <lie.1296 at gmail.com> wrote:
> > On 09/27/10 09:45, Jojo Mwebaze wrote:
> >> Hey Tutor,
> >>
> >> Seems a small issue but this has been playing for a while now, what am i
> >> doing wrong here?
> >>
> >
> > super() without argument only works for Python 3. In Python 2.x, you
> > have to pass to super your class name and your class instance, i.e.:
> >
> > Class Circle(Point):
> >     def __init__(self, radius=0, x=0, y=0):
> >         super(Point, self).__init__(x, y)
> >         self.radius = radius
> >
> > _______________________________________________
> > Tutor maillist  -  Tutor at python.org
> > To unsubscribe or change subscription options:
> > http://mail.python.org/mailman/listinfo/tutor
> >
>
> --
> Sent from my mobile device
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100927/856441de/attachment-0001.html>


More information about the Tutor mailing list