Skip to content

trio.sleep(float('nan')) is valid and sleeps forever #2493

@jakkdl

Description

@jakkdl

trio.sleep(float('nan')) currently sleeps forever. Fixing it is pretty trivial by reordering the if statements but there's maybe other stuff that would break with NaN, and it might not be worth fixing a theoretical issue that idk if it might ever happen in reality - though I could imagine it biting somebody somewhere.

for reference: time.sleep() gives a ValueError, asyncio.sleep() sleeps for 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions