Skip to content

Instantly share code, notes, and snippets.

@nosamanuel
Created March 17, 2013 06:23
Show Gist options
  • Save nosamanuel/5180376 to your computer and use it in GitHub Desktop.
Save nosamanuel/5180376 to your computer and use it in GitHub Desktop.
Curiosity about garbage collection and generator.send
state = {}
def generator():
state['generator'] = yield None
yield None
def main():
g = generator()
g.next()
g.send(g)
del g
print state
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment