title: variables as decorator arguments
body: <p>I have found out that decorator arguments are passed at decorator definition rather than invocation like with functions.</p>
  
  <p>Now I wonder if it is possible to make the decorater get the value of a variable at runtime like this, the decorater should print the current value of state instead of the one it head at definition:</p>
  
  <pre><code>def deco(msg):
      def decorater(func):
          def wrapper(*args, **kwargs):
              print msg
              func(*args, **kwargs)
          return wrapper
      return decorater
  
  
  def func():
      local = {
          "state": None
      }
  
      @deco(local["state"])
      def test():
          pass
  
      def setState(newState):
          local["state"] = newState
  
      setState("start")
      test()
      setState("test")
      test()
  
  func()
  </code></pre>