error while defining a method with 1 parameter in python
<p>I try to define the function <code>up</code> with 1 parameter in class <code>X</code>, like this:</p>

<pre><code>class X:

    def __init__(self):
        self.elem=[]

    def i(self, new):
        self.elem.append(new)
        self.up(self,len(self.elem)-1)                    &lt;= error here

    def up(self, n):
        print n

border = X()

a = [2,4,3,1]

for i in a:
    border.i (i)
</code></pre>

<p>The error looks like this:</p>

<pre><code>$ Traceback (most recent call last):
  File "p.py", line 60, in &lt;module&gt;
    border.i (i)
  File "prim.py", line 50, in i
    self.up(self,len(self.elem)-1)
TypeError: up() takes exactly 2 arguments (3 given)
$ 
</code></pre>

<p>if I call in <code>i</code> like this <code>self.up(self)</code> , it compiles, and <code>print n</code> displays so:</p>

<pre><code>$ &lt;__main__.X instance at 0x7f7a7ddf0128&gt;
&lt;__main__.X instance at 0x7f7a7ddf0128&gt;
&lt;__main__.X instance at 0x7f7a7ddf0128&gt;
&lt;__main__.X instance at 0x7f7a7ddf0128&gt;
$ 
</code></pre>
