title: How to use random.shuffle() on a generator? python
body: <p>How do I use random.shuffle() on a generator without initializing a list from the generator? 
  Is that even possible? if not, how else should I use <code>random.shuffle()</code> on my list?</p>
  
  <pre><code>&gt;&gt;&gt; import random
  &gt;&gt;&gt; random.seed(2)
  &gt;&gt;&gt; x = [1,2,3,4,5,6,7,8,9]
  &gt;&gt;&gt; def yielding(ls):
  ...     for i in ls:
  ...             yield i
  ... 
  &gt;&gt;&gt; for i in random.shuffle(yielding(x)):
  ...     print i
  ... 
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/usr/lib/python2.7/random.py", line 287, in shuffle
      for i in reversed(xrange(1, len(x))):
  TypeError: object of type 'generator' has no len()
  </code></pre>
  
  <p>Note: <code>random.seed()</code> was designed such that it returns the same output after each script run?</p>