I currently have code like this:
cache = 1 def foo(): global cache # many # lines # of code cache = 2
However, this may
Using global variable is not a good programming practice. Pass the variable as an argument: make function returns something and use it in another function. Function can be assignment to variable that's how Python works.