in-module global variables

Matthew Banham matb at photond.com
Fri Sep 29 05:29:19 EDT 2000


 Dear Aahz,

> You cannot.  You must explicitly declare that variable to be global
> within each scope by using the "global" statement.  I suggest instead
> that you create a dictionary or class instance and modify its
> attributes (mutable objects can be functionally global because you only
> change their internal state, not the object reference itself).
> -- 

Yes, that's a good solution too. Thank you.





More information about the Python-list mailing list