Skip to content

docs: improve CancelScope.relative_deadline docstring - #3600

Closed
swastiktawate wants to merge 1 commit into
python-trio:mainfrom
swastiktawate:fix-3221-relative-deadline-docstring
Closed

swastiktawate wants to merge 1 commit into
python-trio:mainfrom
swastiktawate:fix-3221-relative-deadline-docstring

Conversation

@swastiktawate

Copy link
Copy Markdown

Fixes #3221 (relative_deadline item).

The old docstring said the value was relative to the current time, which is only true after the scope is entered. Before entry the countdown has not started yet. This rewrites the docstring to explain both cases: before entering, reading returns the value from the constructor and setting it changes the delay used at entry; after entering, reading returns the time left until the deadline and setting it moves the deadline to now plus the new value.

@A5rocks A5rocks closed this Nov 18, 2026
@codecov

codecov Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.16725%. Comparing base (76d58d1) to head (3bb94a6).

Additional details and impacted files
@@                 Coverage Diff                  @@
##                 main       #3600         +/-   ##
====================================================
- Coverage   100.00000%   98.16725%   -1.83276%     
====================================================
  Files             128         128                 
  Lines           19586       19970        +384     
  Branches         1334        1398         +64     
====================================================
+ Hits            19586       19604         +18     
- Misses              0         359        +359     
- Partials            0           7          +7     
Files with missing lines Coverage Δ
src/trio/_core/_run.py 99.15730% <ø> (-0.84270%) ⬇️

... and 55 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some functions and properties in the documentation have no docstring

2 participants