spacepaste

  1.  
  2. >>> x = ((yield x) for x in range(10))
  3. >>> x.next()
  4. 0
  5. >>> x.next()
  6. >>> x.next()
  7. 1
  8. >>> x.next()
  9. >>> x.next()
  10. 2
  11. >>>
  12.