[Tutor] when to use "self."
Brendon
bren@europe.nl.com
Mon, 2 Jul 2001 17:18:13 +0200
On Monday 02 July 2001 16:57, you wrote:
> > i suppose it has to be used if you need to access a widget because you
> > have to call it somehow and doing so without the 'self.' would call a
> > local function. erm, right? heh.
> >
> > are there any short docs on this?
>
> Maybe I'm missing something here, but it depends upon your understanding of
> "self".
>
> You need to use it to define object methods... but you do understand what
> classes do, don't you?
>
> OK, I'm definitely missing something here. :) Just let us know if you
> understand about classes and then we can move on from there...
>
just another thing i need to get used to i'm guessing :)
yes, i know about classes.
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.
--
"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