python-trio / python-trio/trio
Is it better to have sleep(0), sleep(x), sleep(inf), or checkpoint(), sleep(x), sleep_forever()?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.3k
- Forks
- 431
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 6
Description
Speaking of cleaning up names and namespaces, sleep_forever is also accessible as sleep(inf) or sleep_until(inf). Does it really need a top-level name? And frankly the sleep_forever name is kinda confusing – wouldn't wait_cancelled or something make more sense?
Maybe we should make it so the inf versions of sleep special case this for the marginal efficiency gain (like sleep(0) does), and then make that the One Way of getting these semantics.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the existing sleep(0), sleep(x), sleep(inf), sleep_until(inf), and sleep_forever entry points. Determine whether the proposal should unify the infinite-sleep semantics, remove or rename the top-level API, or retain the current alternatives. Done requires a decided API direction and agreement on its naming and behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100