title: How can a function accept a colon (range operator) as an argument (in Python)?
body: <p>I want to do the following: I want to define a recursive function <code>funct</code> in which the last reference of itself return a number of the array <code>temp</code>. The problem is that <code>funct</code> must do an integral of itself (see the code below) and this would be very easy if <code>funct</code> could accept the colon <code>:</code> as an argument. So, I have this (simplified) code so far:</p>
  
  <pre><code>import numpy as np   
  import scipy.integrate as ints
  
  temp = np.array([[1,2,3,4,5],[4,0,6,7,8],[7,8,9,10,11],[1,2,3,4,5],[6,7,8,9,10]])
  
  def funct(x,y,n):
      if n&gt;1:
          return (temp[x,y] + ints.cumtrapz(temp[x,:]*funct(:,y,n-1), x=None, dx=1, initial=0)[-1])
      else:
          return temp[x,y]
  funct = np.vectorize(funct)
  funct(1,1,3)
  </code></pre>
  
  <p>The problem is that <code>funct</code> can't accept the colon <code>:</code> as argument, it doesn't matter if I want to <em>vectorize</em> to <code>funct</code> later in the code.</p>
  
  <p>For instance, If I change this part of the above code </p>
  
  <pre><code>ints.cumtrapz(temp[x,:]*funct(:,y,n-1), x=None, dx=1, initial=0)[-1]) 
  </code></pre>
  
  <p>for </p>
  
  <pre><code>ints.cumtrapz(temp[x,:]*temp[:,y], x=None, dx=1, initial=0)[-1]) 
  </code></pre>
  
  <p>I have no problems. I just want to do the last part recursively.</p>