Conditionally modify global variable
<p>I'd like to do something like this, but I get a SyntaxWarning and it doesn't work as expected</p>

<pre><code>RAWR = "hi"
def test(bool):
    if bool:
        RAWR = "hello"   # make RAWR a new variable, don't reference global in this function
    else:
        global RAWR
        RAWR = "rawr"    # reference global variable in this function
    print RAWR           # if bool, use local, else use global (and modify global)
</code></pre>

<p>How do I get this to work? Passing in True or False modifies the global variable.</p>
