I thought I'd 'got' globals but...

Markus Wankus markus_wankus at hotmail.com
Fri Jul 7 20:10:25 EDT 2006


On Fri, 07 Jul 2006 19:41:36 -0400, Luis M. González <luismgz at gmail.com>  
wrote:
.
.
> OK, so I should include the global only if I plan to modify it.
> Otherwise, I don't need to include it. Am I right?
>

Correct.  Globals are always available to read from.  You need to declare  
them if you want to modify them in another scope.  Like nate, I also tend  
to declare them all the time if I am going to use them, just for clarity.

M.



More information about the Python-list mailing list