trio icon indicating copy to clipboard operation
trio copied to clipboard

trio.sleep_forever should mention that it raises if rescheduled

Open A5rocks opened this issue 1 year ago • 1 comments

This causes a regression for anyone who was using trio.sleep_forever combined with trio.lowlevel.reschedule. Okay, maybe they (we (I)) should have been using trio.lowlevel.wait_task_rescheduled but the RuntimeError should have been phased in with a warning over one release cycle.

Originally posted by @richardsheridan in https://github.com/python-trio/trio/pull/3096#issuecomment-2422986247

A5rocks avatar Oct 18 '24 18:10 A5rocks

I think this regression is ultimately ok, especially since it's already done. We can update the docstring to mention this as in https://github.com/python-trio/trio/pull/3096#issuecomment-2422995153.

A5rocks avatar Oct 18 '24 18:10 A5rocks