title: python permutations with more randomization
body: <p>I'm trying to generate permutation from a list of indices, currently, I am using <code>itertools.permutation</code>. It's okay, except I need a really random nature of the indices as <strong>I will not be able to select all the permutations</strong>, but a very short subset of the total set (initial ones) for simulation.</p>
  <p>For <code>itertools.permutation</code>:
  <em>The permutation tuples are emitted in lexicographic ordering according to the order of the input iterable. So, if the input iterable is sorted, the combination tuples will be produced in sorted order.</em></p>
  <pre><code>import itertools
  for ind, idxs in enumerate(itertools.permutations(range(5))):
    print(ind)
    print(idxs)
    print('--------')
  </code></pre>
  <pre><code>0
  (0, 1, 2, 3, 4)
  --------
  1
  (0, 1, 2, 4, 3)
  --------
  2
  (0, 1, 3, 2, 4)
  --------
  3
  (0, 1, 3, 4, 2)
  --------
  4
  (0, 1, 4, 2, 3)
  --------
  5
  (0, 1, 4, 3, 2)
  --------
  6
  (0, 2, 1, 3, 4)
  --------
  7
  (0, 2, 1, 4, 3)
  --------
  8
  (0, 2, 3, 1, 4)
  --------
  9
  (0, 2, 3, 4, 1)
  --------
  10
  (0, 2, 4, 1, 3)
  --------
  11
  (0, 2, 4, 3, 1)
  --------
  12
  (0, 3, 1, 2, 4)
  --------
  13
  (0, 3, 1, 4, 2)
  --------
  </code></pre>
  <p>One solution definitely comes to my mind is to shuffle the list each time to get a random order, but that makes the idea of permutation obsolete, which is not desired as there is a chance that the same sample will be generated more than once. The permutation should be generated iteratively, so I can not just do <code>list(itertools.permutation..)</code> as this will make a really unnecessary long list.</p>