Skip to content

Instantly share code, notes, and snippets.

@poros
Created October 7, 2015 09:41
Show Gist options
  • Save poros/0241e2a996ff57f398fb to your computer and use it in GitHub Desktop.
Save poros/0241e2a996ff57f398fb to your computer and use it in GitHub Desktop.
Trace a generator for debugging
def trace(source):
for item in source:
print item
yield item
r404 = trace(r for r in log if r['status'] == 404)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment