But they're not globals. They disappear when references are lost. Globals don't do that.
And you can totally test globals. I do it all the time. Any function that has a side effect is basically doing the same thing as a function that modifies a global.
1
u/[deleted] Jan 09 '18
I disagree. I use globals all the time to share global state between code. If Python had dynamic variables, I'd use them too.
In a way, Java classes themselves are globals. Sacrilege, I know.
EDIT: By the way, are you going to yield the point and agree with me that Java does not have globals?