Attributes not available when overwriting __init__?
<p>I'm trying to overwrite a <code>__init__</code> method, but when I call the super method the attributes created in that method are not available.
I can see that it's not an inheritance problem since <code>class B</code> still has the attributes available.</p>

<p>I think the code sample will explain it better :-)</p>

<pre><code>Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49) 
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; class A(object):
...   def __init__(self, *args, **kwargs):
...     self.args = args
...     self.kwargs = kwargs
... 
&gt;&gt;&gt; a = A('a', 'b', key='value')
&gt;&gt;&gt; print a.args, a.kwargs
('a', 'b') {'key': 'value'}
&gt;&gt;&gt; class B(A):
...   pass
... 
&gt;&gt;&gt; b = B('b', 'c', key_b='value_b')
&gt;&gt;&gt; print b.args, b.kwargs
('b', 'c') {'key_b': 'value_b'}
&gt;&gt;&gt; class C(A):
...   def __init__(self, *args, **kwargs):
...     print 'class C'
...     super(A, self).__init__(*args, **kwargs)
... 
&gt;&gt;&gt; c = C('c', 'd', key_c='value_C')
class C
&gt;&gt;&gt; print c.args, c.kwargs
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
AttributeError: 'C' object has no attribute 'args'
&gt;&gt;&gt; class D(A):
...   def __init__(self, *args, **kwargs):
...     super(A, self).__init__(*args, **kwargs)
...     print 'D'
... 
&gt;&gt;&gt; d = D('d', 'e', key_d='value D')
D
&gt;&gt;&gt; print d.args, d.kwargs
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
AttributeError: 'D' object has no attribute 'args'
&gt;&gt;&gt;
</code></pre>
