I have a Python module with a few functions. At the moment, these functions are only called from main(), but I expect to import the module from other files in the future.
I have a counter
variable that is used and modified by most of these functions. At the moment I am passing it around as a parameter, and returning it with every function call.
This works but seems silly. I considered including a constant variable COUNTER
that is used directly by all functions. However, I assume that constants are not supposed to be modified.
Is there a cleaner approach than passing the counter
variable back and forth?