Impossible to set an attribute to a string?
<p>Usually, you can set an arbitrary attribute to a custom object, for instance </p>

<pre><code>----------
&gt;&gt;&gt; a=A()
&gt;&gt;&gt; a.foo=42
&gt;&gt;&gt; a.__dict__
{'foo': 42}
&gt;&gt;&gt; 
----------
</code></pre>

<p>On the other hand, you can't do the same binding with a string object :</p>

<pre><code>----------
&gt;&gt;&gt; a=str("bar")
&gt;&gt;&gt; a.foo=42
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
AttributeError: 'str' object has no attribute 'foo'
&gt;&gt;&gt; a.__dict__
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
AttributeError: 'str' object has no attribute '__dict__'
&gt;&gt;&gt;
----------
</code></pre>

<p>Why ?</p>
