title: Give function defaults arguments from a dictionary in Python
body: <p>Let's imagine I have a dict :</p>
  
  <pre><code>d = {'a': 3, 'b':4}
  </code></pre>
  
  <p>I want to create a function f that does the exact same thing than this function : </p>
  
  <pre><code>def f(x, a=d['a'], b=d['b']):
    print(x, a, b)
  </code></pre>
  
  <p>(Not necessarily print, but do some stuff with the variable and calling directly from their name).</p>
  
  <p>But I would like to create this function directly from the dict, that is to say, I would like to have something that look likes</p>
  
  <pre><code>def f(x, **d=d):
    print(x, a, b)
  </code></pre>
  
  <p>and that behaves like the previously defined function. The idea is that I have a large dictionary that contains defaults values for arguments of my function, and I would like not to have to do </p>
  
  <pre><code>def f(a= d['a'], b = d['b'] ...)
  </code></pre>
  
  <p>I don't know if it's possible at all in python. Any insight is appreciated !</p>
  
  <p>Edit : The idea is to be able to call <code>f(5, a=3)</code>.
  Edit2 : The question is not about passing arguments stored in a dict to a function but to define a function whose arguments names and defaults values are stored in a dict.</p>