title: Performance implications of unpacking dictionaries in Python
body: <p>I have a chunk of code that takes a series of variables and passes them to N number of modules.  To simplify readability of code rather than passing the variables over and over again I created a dictionary and unpack that to modules as follows:</p>
  
  <pre><code>message_package = {
      'v1' : v1,
      'v2' : v2,
      'v3' : v3
  }
  for mod in mods:
     mod.f1(**message_package)
  [...]
  if condition:
     mod.f2(**message_package)
  </code></pre>
  
  <p>Each module then grabs variables they need and ignore the rest:</p>
  
  <pre><code>def mod1.f1(v1=None,**kwargs):
     do_something()
  </code></pre>
  
  <p>From a readability/usability standpoint I find this quite nice -- variables are immediately available without having to pull them out of **kwargs, and if I add a variable to the message package it's only one line and I don't have to update all modules.</p>
  
  <p>As I'm somewhat new to Python I'm wondering... is this very unpythonic? Is there a big performance impact from constantly unpacking these dictionaries and/or is there a better way to do this?</p>