title: Ruby generators vs Python generators
body: <p>I've been researching the similarities/differences between Ruby and Python generators (known as <code>Enumerators</code> in Ruby), and so far as i can tell they're pretty much equivalent. </p>
  
  <p>However one difference i've noticed is that Python Generators support a <code>close()</code> method whereas Ruby Generators do not. From the Python docs the <code>close()</code> method is said to do the following:</p>
  
  <blockquote>
    <p>Raises a GeneratorExit at the point where the generator function was paused. If the generator function then raises StopIteration (by exiting normally, or due to already being closed) or GeneratorExit (by not catching the exception), close returns to its caller."</p>
  </blockquote>
  
  <p>Is there a good reason why Ruby <code>Enumerators</code> don't support the <code>close()</code> method? Or is it an accidental 
  omission?</p>
  
  <p>I also discovered that Ruby <code>Enumerators</code> support a <code>rewind()</code> method yet Python generators do not...is there a reason for this too?</p>
  
  <p>Thanks</p>