curio icon indicating copy to clipboard operation
curio copied to clipboard

Docstring for curio.traps._sleep is inaccurate

Open zbentley opened this issue 1 year ago • 0 comments

The docstring for curio.traps._sleep reads:

    Sleep until the monotonic clock reaches the specified clock value.
    If clock is 0, forces the current task to yield to the next task (if any).

The first line is inaccurate. _sleep does not sleep until the supplied value is less than or equal to "now"; it sleeps for specified value interpreted as a number of seconds, according to the kernel source here: https://github.com/dabeaz/curio/blob/148454621f9bd8dd843f591e87715415431f6979/curio/kernel.py#L541

zbentley avatar Oct 14 '24 13:10 zbentley