title: Local (?) variable referenced before assignment
body: <pre><code>test1 = 0
  def test_func():
      test1 += 1
  test_func()
  </code></pre>
  <p>I am receiving the following error:</p>
  <blockquote>
  <p>UnboundLocalError: local variable 'test1' referenced before assignment.</p>
  </blockquote>
  <p>Error says that <code>'test1'</code> is local variable but i thought that this variable is global</p>
  <p>So is it global or local and how to solve this error without passing global <code>test1</code> as argument to <code>test_func</code>?</p>