title: How to access an object attribute with a dot in its name
body: <p>I am using a bunch class to transform a dict to an object.</p>
  
  <pre><code>class Bunch(object):
      """ Transform a dict to an object """
      def __init__(self, kwargs):
          self.__dict__.update(kwargs)
  </code></pre>
  
  <p>The problem is , i have a key with a dot in its name({'test.this':True}).</p>
  
  <p>So when i call:</p>
  
  <pre><code>spam = Bunch({'test.this':True})
  dir(spam)
  </code></pre>
  
  <p>I have the attibute:</p>
  
  <pre><code>['__class__',
   '__delattr__',
  ...
   '__weakref__',
   'test.this']
  </code></pre>
  
  <p>But i can't access it:</p>
  
  <pre><code>print(spam.test.this)
  ---------------------------------------------------------------------------
  AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-7-ea63f60f74ca&gt; in &lt;module&gt;()
  ----&gt; 1 print(spam.test.this)
  
  AttributeError: 'Bunch' object has no attribute 'test'
  </code></pre>
  
  <p>i got an AttributeError.</p>
  
  <p>How can i access this attribute?</p>