[Tutor] when to use "self."

Brendon bren@europe.nl.com
Mon, 2 Jul 2001 18:51:43 +0200


> > perhaps i'm just confused. when defining a class and giving it some
> > widgets, methods (hum, why not just call them functions?.. grr) and data
> > they all need to be perceded by 'self.' with exception of methods (only a
> > call to one) and variables used internally, non?
> >
> > i think i saw an example where this was not the case, hence the
> > confusion.
>
> Ahh, now it makes a lot more sense now. :)
>
> Regarding methods ("why not call them functions"), it's because you are
> invoking a function which is attached to an object. Some OO king in the
> past must have come up with the name, and this is his legacy to us. :)
>
> So that should make things clearer. 
>

yup, i think i get it now. cheers :)
-- 

"if we live by an "eye for an eye and a tooth for a tooth"...before long, 
the whole world will be blind and toothless." 
         --Tevye, Fiddler on the Roof