Skip to content

Instantly share code, notes, and snippets.

@erikfrey
Created October 8, 2010 20:46
Show Gist options
  • Save erikfrey/617506 to your computer and use it in GitHub Desktop.
Save erikfrey/617506 to your computer and use it in GitHub Desktop.
>>> def foo():
... raise StopIteration
...
>>> list(foo())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in foo
StopIteration
>>> def foo():
... raise StopIteration
... yield
...
>>> list(foo())
[]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment