[Tutor] Why thus?
Sun, 12 Mar 2000 15:56:19 -0500
> :: Use the "global" statement, i.e. "global counter" within
> :: __init__.
> Additionally, Arthur, you would probably benefit from reading
> (rereading?) the Python Tutorial, Chapter 9, Section 2 -- "Python Scopes
> and Name Spaces," so as to have an overview of why global is necessary
The global statement clearly solves the practical problem. But having now
scope and name space section, I can't say I fully get it.
My problem seems to be understanding the significant difference between the
"print counter" statement - which can print the value of the "counter"
variable from within the class __init__
which generates the error saying I never heard of "counter".
Then why can it print the value.
See where my confusion lies?