mirror of
https://github.com/python/cpython
synced 2024-09-20 08:38:37 +00:00
bpo-32351: Use fastpath in asyncio.sleep if delay<0 (#4908)
* Use fastpath in asyncio.sleep if delay<0 * Add NEWS entry
This commit is contained in:
parent
44d1a5912e
commit
5382c05021
|
@ -503,7 +503,7 @@ def __sleep0():
|
|||
|
||||
async def sleep(delay, result=None, *, loop=None):
|
||||
"""Coroutine that completes after a given time (in seconds)."""
|
||||
if delay == 0:
|
||||
if delay <= 0:
|
||||
await __sleep0()
|
||||
return result
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Use fastpath in asyncio.sleep if delay<0 (2x boost)
|
Loading…
Reference in a new issue