title: Reusing generator expressions
body: <p>Generator expressions is an extremely useful tool, and has a huge advantage over list comprehensions, which is the fact that it does not allocate memory for a new array.</p>
  
  <p>The problem I am facing with generator expressions, which eventually makes me end up writing list comprehensions, is that I can only use a such a generator once:</p>
  
  <pre><code>&gt;&gt;&gt; names = ['John', 'George', 'Paul', 'Ringo']
  &gt;&gt;&gt; has_o = (name for name in names if 'o' in name)
  &gt;&gt;&gt; for name in has_o:
  ...   print(name.upper())
  ...
  JOHN
  GEORGE
  RINGO
  &gt;&gt;&gt; for name in has_o:
  ...   print(name.lower())
  ...
  &gt;&gt;&gt;
  </code></pre>
  
  <p>The above code illustrates how the generator expression can only be used once. That's of course, because the generator expression returns <strong>an instance</strong> of the generator, rather than defining a generator function which could be instantiated again and again.</p>
  
  <p>Is there a way to clone the generator each time it is used, in order to make it reusable, or to make the generator expressions syntax return a generator function rather than a single instance?</p>