[Tutor] class question
pythontut at pusspaws.net
Tue May 18 04:47:48 EDT 2004
Dave S wrote:
> I guess Im one of those guys for whom classes do not come easy !
> class test:
> def __init__(self):
> def somedef(self):
> In a class structure, you can use either a simple a=2 or self.a=2. OK
> Ive read the text but am still not clear.
> The self.a=2 tags this variable to the genrated instance via self ....
> ok ... and appears to be a global variable.
> So what happens with plain a=2.
> What I am asking is when sould I use a=2 & when self.a=2 ?
> Thanks in advance
Doh ... got it !
More information about the Tutor