title: Python random.shuffle() returning different results when function passed in
body: <p>I'm trying to unit test some code that makes use of <code>random.shuffle(a, func)</code>. In order to keep the ordering deterministic, I pass in a func defined as:</p>
  <pre><code>def func():
    return 0.1
  </code></pre>
  <p>what's strange is that the list seems to still get shuffled.</p>
  <pre><code>import random
  
  def func():
    return 0.1
  
  a = ['c', 'good', 'b', 'hello', 'a']
  random.shuffle(a, func)
  print(a)
  
  random.shuffle(a, func)
  print(a)
  
  random.shuffle(a, func)
  print(a)
  
  </code></pre>
  <p>output:</p>
  <pre><code>['good', 'b', 'hello', 'a', 'c']
  ['b', 'hello', 'a', 'c', 'good']
  ['hello', 'a', 'c', 'good', 'b']
  </code></pre>
  <p>What's going on here?</p>