On Mon, 2002-11-25 at 19:27, Tim Legant wrote:
> David Guerizec <[EMAIL PROTECTED]> writes:
> > # prints:
> > # [A]: shared: 2 local: 1
> > # [B]: shared: 2 local: 0
> 
> This is interesting.  It appears that, while you can "read" shared
> variables through 'self', you can't "write" them through 'self'.
> Python creates a new instance variable when you try to write a shared
> variable through self.

This is the magic of references, once you get used to it, you can't do
without (well sometimes it bites you too!).

> I have been writing Python for almost 5 years
> and was unaware of that distinction.  Ya learn something new every
> day!

Maybe I was aware of that because as a true beginner I just read
'Introduction to Python' during my last holidays ;)

David
_________________________________________________
tmda-workers mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-workers

Reply via email to