[Tutor] Query - Where to put in global variables, if needed, as a good programming practice

spawgi at gmail.com spawgi at gmail.com
Fri Jun 15 13:44:56 CEST 2012


The point of good-bad-ness of global variables aside, if I needed to use
them, which is a better place to put them.
1. In the __init__ function of a class? So they are available at the time
an object is initialized or
2. In the actual function of the class where the variables are needed?
Pros and Cons of either approach?

Thanks and Regards,

We can do it and do it better.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120615/515ac718/attachment.html>

More information about the Tutor mailing list