Skip to content

Instantly share code, notes, and snippets.

@radix
Created July 24, 2013 15:31
Show Gist options
  • Save radix/6071653 to your computer and use it in GitHub Desktop.
Save radix/6071653 to your computer and use it in GitHub Desktop.
basic generator tracebacks
>>> def g1():
... for x in g2():
... yield x
...
>>> def g2():
... yield 1
... yield 2
... 1 / 0
...
>>> for x in g1(): pass
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in g1
File "<stdin>", line 4, in g2
ZeroDivisionError: integer division or modulo by zero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment