title: No binding for nonlocal variable declared in a decorator
body: <pre><code>def decorator(func):
      def returning():
          var = 1
          func()
          print(var)
      return(returning)
  @decorator
  def function():
      nonlocal var
      var = 5
  function()
  </code></pre>
  
  <p>var is declared inside the returning() function before calling func(), yet I get a binding error. </p>
  
  <p>I don't understand why this happens.</p>