title: Python: How to obtain the actual parameters of a function call as a dictionary?
body: <p>In a python class's <code>__init__</code> function I want to store all parameters that are passed in as a dictionary to restore the object later on. It's not about the function signature like I could get it form the inspect module, but about the actual parameters and values passed in with the recent call.</p>
  
  <p>Currently, I write code like this:</p>
  
  <pre><code>def __init__(self, param1, param2, param3 = 12, **kwargs):
      self.init_dict = {
           'param1': param1,
           'param2': param2,
           'param3': param3,
      }
      self.init_dict.update(**kwargs)
      ...
  </code></pre>
  
  <p>I think the first lines to store the positional and named parameters to the <code>init_dict</code> are quite tedious.</p>
  
  <p>Isn't there a possibility in python to just get all parameters as a dict and do it like I do with <code>**kwargs</code>?</p>
  
  <p>My gut feeling tells me, that this should be easy, however, I didn't find the correct buzzword for googling.</p>
  
  <p>THX!</p>