title: How to initialize a SimpleNamespace from a dict
body: <p>I'm sure this must be simple, but I could not find the answer.</p>
  
  <p>I have a dictionary like:</p>
  
  <pre><code>d = {'a': 1, 'b':2}
  </code></pre>
  
  <p>I'd like to access that via dot notation, like: <code>d.a</code></p>
  
  <p>The <a href="https://docs.python.org/3/library/types.html" rel="noreferrer"><code>SimpleNamespace</code></a> is designed for this, but I cannot just pass the dict into the SimpleNamespace constructor. 
  I get the error: <code>TypeError: no positional arguments expected</code></p>
  
  <p>How do I initialize the SimpleNamespace from a dictionary?</p>