Skip to content

Instantly share code, notes, and snippets.

@bedekelly
Last active March 11, 2016 04:22
Show Gist options
  • Select an option

  • Save bedekelly/685d10684031280c5350 to your computer and use it in GitHub Desktop.

Select an option

Save bedekelly/685d10684031280c5350 to your computer and use it in GitHub Desktop.
Test a modified recursive generator that previously overflowed the stack
@decorate(bounce, globals(), "new_countdown")
def countdown(a, b):
"""Count down from a to b, printing the numbers, and return b."""
print(a)
if a == b:
yield b
else:
yield countdown(a-1, b)
x = new_countdown(10000, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment