title: Is there a way to set a default parameter equal to another parameter value?
body: <p>For example, I have a basic method that will return a list of permutations.</p>
  
  <pre><code>import itertools
  def perms(elements, set_length=elements):
      data=[]
      for x in range(elements):
          data.append(x+1)
      return list(itertools.permutations(data, set_length))
  </code></pre>
  
  <p>Now I understand, that in its current state this code won't run because the second <code>elements</code> isn't defined, but is there and elegant way to accomplish what I'm trying to do here? If that's still not clear, I want to make the default <code>setLength</code> value equal to the first argument passed in. Thanks.</p>