title: Built-in way to do immutable shuffle in Python (CPython)?
body: <p>The <code>random.shuffle()</code> built-in shuffles in place, which is fine for many purposes. But suppose we would want to leave the original collection intact, and generate a random permutation based on the original sequence, is there a prefered way to do this in the standard library?</p>
  
  <p>When I look at <a href="https://github.com/python/cpython/blob/master/Lib/random.py" rel="nofollow noreferrer">CPython's random.py</a> I see an intial comment that reads:</p>
  
  <pre><code>sequences
      ---------
             pick random element
             pick random sample
             pick weighted random sample
             generate random permutation
  </code></pre>
  
  <p>Particularly, the last line is of interest. However, I struggle to see what method in this class achieves this.</p>
  
  <p>Naturally, this is not a hard problem to solve, even for a novice Python programmer. But it would be nice to have a standard way of doing it in the standard library, and I'm sure it must exist somewhere. Perhaps someplace other than <code>random.py</code>?</p>