title: Proper way to use **kwargs in Python
body: <p>What is the proper way to use <code>**kwargs</code> in Python when it comes to default values?</p>
  
  <p><code>kwargs</code> returns a dictionary, but what is the best way to set default values, or is there one?  Should I just access it as a dictionary?  Use get function?  </p>
  
  <pre><code>class ExampleClass:
      def __init__(self, **kwargs):
          self.val = kwargs['val']
          self.val2 = kwargs.get('val2')
  </code></pre>
  
  <p>A simple question, but one that I can't find good resources on.  People do it different ways in code that I've seen and it's hard to know what to use.</p>