[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]
mailto:[EMAIL PROTECTED]
510 558 3275 home
720 938 2625 cell
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor