# These examples are probably not meant to ever wake up:
await trio.sleep(100000)
await trio.sleep(10**10)
# and these ones _definitely_ never wake up:
await trio.sleep(float("inf"))
await trio.sleep(math.inf)
await trio.sleep(1e999) # 'inf literal' overflow trick
This is a pretty simple check, but using await trio.sleep_forever() instead does have a certain elegance - and the first example (real code) might actually wake up if you leave the process running for ~27 hours!
This is a pretty simple check, but using
await trio.sleep_forever()
instead does have a certain elegance - and the first example (real code) might actually wake up if you leave the process running for ~27 hours!