python how to overload maybe?? the constuctor
<p>i have this code :</p>

<pre><code>class random_walk:
    #ns: number of steps1d
    #np: number of particles
    #dimension : choose between 1D or 2D
    def __init__(self,ns,np,dimension=None):
        self.ns=ns
        self.np=np
        self.dimension=dimension

    def steps1d(self,ns):    
        return 2*sc.random.random_integers(0,1,size=self.ns)-1

    # The position of particles after the n-th steps1d is given from the sum of n first steps1d
    def Walk1d(self,ns):
        return sc.cumsum(random_walk.steps1d(self,self.ns)
.....
</code></pre>

<p>When i do :</p>

<pre><code>ns=10000
np=100
dimension=2
rw1=random_walk(ns,np)  # for 1d
</code></pre>

<p>the rw1 creates an instance for the class random_walks,which has ns=10000.</p>

<p>Now,if for example i want to do :</p>

<pre><code>print('walk1d(10)=',rw1.Walk1d(10)) 
</code></pre>

<p>it will give me 10000 size array (because if i am telling this right ,it created an instance before with 10000 ns).
So, if i want to apply the above statement in order to give me 10 size array what solutions exists?</p>
