[Tutor] when to use "self."

ak@silmarill.org ak@silmarill.org
Mon, 02 Jul 2001 12:25:31 -0400


On Mon, Jul 02, 2001 at 05:18:13PM +0200, Brendon wrote:
> 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.

Read tutorial(s) about classes.

> -- 
> 
> "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
> 
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor

-- 
Cymbaline: intelligent learning mp3 player - python, linux, console.
get it at: http://silmarill.org/cymbaline