title: Why can't you add attributes to object in python?
body: <p>(Written in Python shell)</p>
  
  <pre><code>&gt;&gt;&gt; o = object()
  &gt;&gt;&gt; o.test = 1
  
  Traceback (most recent call last):
    File "&lt;pyshell#45&gt;", line 1, in &lt;module&gt;
      o.test = 1
  AttributeError: 'object' object has no attribute 'test'
  &gt;&gt;&gt; class test1:
      pass
  
  &gt;&gt;&gt; t = test1()
  &gt;&gt;&gt; t.test
  
  Traceback (most recent call last):
    File "&lt;pyshell#50&gt;", line 1, in &lt;module&gt;
      t.test
  AttributeError: test1 instance has no attribute 'test'
  &gt;&gt;&gt; t.test = 1
  &gt;&gt;&gt; t.test
  1
  &gt;&gt;&gt; class test2(object):
      pass
  
  &gt;&gt;&gt; t = test2()
  &gt;&gt;&gt; t.test = 1
  &gt;&gt;&gt; t.test
  1
  &gt;&gt;&gt; 
  </code></pre>
  
  <p>Why doesn't object allow you to add attributes to it?</p>