title: Python: Is there a way to make a variable ALWAYS global?
body: <p>I'm writing a script that is starting to accumulate a significant number of functions that call other functions. There are variables that serve as global counters, or keep track of a frequently updated rotation angle, or to store assets that get referenced by the various functions. So a lot of my functions are ending up with up to 7 lines of code just to specify that these variables are global.</p>
  <p>It's getting to be redundant. To use an analogy, when talking about The Statue of Liberty in a conversation you wouldn't begin with &quot;The Statue of Liberty, on Liberty Island, within the borough of Manhattan, in the City of New York, within the state of New York... not the tiny one inside the snow globe on my mantle. Anyway, about that biggest and most famous Statue of Liberty, what I want to tell you is...&quot; And imagine if <em>every</em> time you brought up the statue you had to be <em>that</em> specific because there was no way to simply say THE Statue of Liberty and be understood. That's where I feel like I am with Python right now, constantly having to tell my functions that many of my variables are global.</p>
  <p>I'm a beginner with Python, so I'm probably missing something obvious. <strong>Is there a better way to approach this?</strong></p>
  <p>One thought I had is that maybe I should pass more variables through functions as arguments, but then I find it harder to keep track of the <em>route</em> that the variables travel, as opposed to just having to know their current <em>state</em>, like when they're global.</p>
  <p>In my wishful thinking, there could be some syntax like: <code>alwaysglobal my_var</code> that I could use to tell all the functions that <code>my_var</code> will <em>never</em> be local. I suspect such a thing does not exist though.</p>