title: Set the name of a python object/variable with a string
body: <p>Most people will probably say this is a bad idea.  I want to use the content of a string as the name of a variable.  I want to accomplish the dreaded:</p>
  
  <pre><code>s = 'x'
  x = 1
  </code></pre>
  
  <p>where the variable name <code>x</code> comes (somehow?) from the string <code>s</code>.</p>
  
  <p>To answer the "why?", say I have a global default value for <code>x</code> that I want the option of overriding in a function.  But:</p>
  
  <pre><code>x = 0
  def f(**kw):
      print x
  f(x=1)
  </code></pre>
  
  <p>prints <code>0</code> not <code>1</code>.  If I could use the strings in kw.keys() to reassign <code>x</code> (or any other globally set variables) then I'd be happy.</p>
  
  <p>I realize that this works for reassigning <code>x</code> in <code>f</code>:</p>
  
  <pre><code>x = 0
  def f(x=x):
      print x
  f(x=1)
  </code></pre>
  
  <p>But I want to do this for cases where there are MANY variables in my namespace that I might at some point want to override without rewriting every function definition in my module.</p>