There was an error while loading. Please reload this page.
1 parent 44d1a59 commit 5382c05Copy full SHA for 5382c05
2 files changed
Lib/asyncio/tasks.py
@@ -503,7 +503,7 @@ def __sleep0():
503
504
async def sleep(delay, result=None, *, loop=None):
505
"""Coroutine that completes after a given time (in seconds)."""
506
- if delay == 0:
+ if delay <= 0:
507
await __sleep0()
508
return result
509
Misc/NEWS.d/next/Library/2017-12-17-14-23-23.bpo-32351.95fh2K.rst
@@ -0,0 +1 @@
1
+Use fastpath in asyncio.sleep if delay<0 (2x boost)
0 commit comments