Context for me is the only value of information that I need to keep between calls to a function that changes this value. I could use global, but I know that discouraged. At the moment, I used the default argument in the form of a list containing int, and took advantage of the variability so that changes in the value persist between calls, for example:
def increment(val, saved=[0]):
saved[0] += val
This function attaches to the button via tkinter, for example ~ ~ //
button0 = Button(root, text="demo", command=lambda: increment(val))
which means there is no return value that I can assign to a local variable outside the function.
How do people usually deal with this? I mean, of course, the trick with variability works and thatβs it, but what if I need to access and change this value from several functions?
..?