title: How can I pass my locals and access the variables directly from another function?
body: <p>Let's say I have this :</p>
  
  <pre><code>
  def a(dict):
    locals().update(dict)
    print size
  
  def b():
    size = 20
    f(locals())
  </code></pre>
  
  <p>What do I have to do to access the <code>size</code> variable directly from the <code>a</code> function? I know of :</p>
  
  <pre><code>
  size = dict["size"]
  </code></pre>
  
  <p>but I think there should be a more direct way. I tried using <code>locals().update(dict)</code> but it didn't work. Is there a betteer way ?</p>