At 09:22 AM 5/7/2005, Brian van den Broek wrote:
[snip]

global will indeed fix that, yes. But, I've been lead to believe that
one's first thought when tempted to write a global statement should be
to reflect on whether that temptation isn't the symptom of a
sub-optimal design. It certainly can (in my case has) lead to bugs
when two separate bits of code both declare the same name global and
thus each make their changes to it, after I have forgotten that I made
both functions declare the name global.

Yes I agree. I was pondering this as I wrote my "reply". For quick and dirty programming global can save the day. For anything intended to be larger, more permanent I usually advocate use of classes.

[snip]

Bob Gailer
mailto:[EMAIL PROTECTED]
510 558 3275 home
720 938 2625 cell

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to