title: python - match on array return value
body: <p>I want to do a functional like pattern match to get the first two elements, and then the rest of an array return value.</p>
  
  <p>For example, assume that perms(x) returns a list of values, and I want to do this:</p>
  
  <pre><code>seq=perms(x)
  a = seq[0]
  b = seq[1]
  rest = seq[2:]
  </code></pre>
  
  <p>Of course I can shorten to:</p>
  
  <pre><code>[a,b] = seq[0:2]
  rest  = seq[2:]
  </code></pre>
  
  <p>Can I use some notation to do this?</p>
  
  <pre><code>[a,b,more] = perms(x)
  </code></pre>
  
  <p>or conceptually:</p>
  
  <pre><code>[a,b,more..] = perms(x)
  </code></pre>
  
  <p>PROLOG &amp; functional languages do list decomposition so nicely like this!</p>