title: Instance of class `object`
body: <p>I wish to make an instance of built-in class <code>object</code>, and use it as container for some variables (like <code>struct</code> in C++):</p>
  
  <pre><code>Python 3.2 (r32:88445, Mar 25 2011, 19:56:22) 
  &gt;&gt;&gt; a=object()
  &gt;&gt;&gt; a.f=2
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  AttributeError: 'object' object has no attribute 'f'
  </code></pre>
  
  <p>Is there a way to accomplish this easier than doing:</p>
  
  <pre><code>&gt;&gt;&gt; class struct():
  ...     '''Container'''
  ... 
  &gt;&gt;&gt; a=struct()
  &gt;&gt;&gt; a.f=2
  &gt;&gt;&gt; a.f
  2
  &gt;&gt;&gt; 
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <ul>
  <li><p>i need a container to hold some variables, but i don't want to use
  dict - to be able to write <code>a.f = 2</code> instead of <code>a['f'] = 2</code></p></li>
  <li><blockquote>
    <p>using a derived class saves you from typing the quotes</p>
  </blockquote></li>
  <li><p>also, sometimes autocomplete works</p></li>
  </ul>