In article <[email protected]>,
Steven D'Aprano <[email protected]> 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