Skip to content

Instantly share code, notes, and snippets.

@pitrou
Created November 7, 2017 13:42
Show Gist options
  • Save pitrou/296447d747f043cc62fd91a6c114983e to your computer and use it in GitHub Desktop.
Save pitrou/296447d747f043cc62fd91a6c114983e to your computer and use it in GitHub Desktop.
import asyncio
async def coro(n=50):
if n > 1:
await coro(n - 1)
else:
return 42
loop = asyncio.new_event_loop()
loop.set_debug(True)
def func():
loop.run_until_complete(coro())
if __name__ == "__main__":
for i in range(1000):
func()
loop.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment