In article <54ba3654$0$13008$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote:
> Good reasons for using global variables are few and far between. Just about > the only good reason for using global variables that I can think of is if > you have one or more settings/preference that get set once at the start of > the program and then apply to the entire program. I will commonly put something like: import logging logger = logging.getLogger("logger-name-for-my-module") in every source file in a big project. Now I've got a global logger I can use anywhere in the module (even in static functions). But, maybe that's just a subset of your "setting that gets set once at the start of the program" example. -- https://mail.python.org/mailman/listinfo/python-list