Title: gh-141186: Document asyncio Task cancellation propagation behavior by mohsinm-dev · Pull Request #141249 · python/cpython · GitHub
Open Graph Title: gh-141186: Document asyncio Task cancellation propagation behavior by mohsinm-dev · Pull Request #141249 · python/cpython
X Title: gh-141186: Document asyncio Task cancellation propagation behavior by mohsinm-dev · Pull Request #141249 · python/cpython
Description: Fixes issue #141186 by documenting that cancelling a Task cancels what it's waiting for. Problem The docs said cancelling a coroutine waiting on a Future cancels the Future, but didn't mention this also happens with Tasks. Users didn't know Tasks work the same way. Solution Added "or Task" to the documentation where it only mentioned Future Explained that cancellation goes down the whole chain of waiting tasks Mentioned that Tasks inherit from Future so they work the same Testing Ran the exact code from the issue - it works as expected. Tested multiple scenarios to confirm the behavior. Documentation-only change. No code was modified. Issue: gh-141186 📚 Documentation preview 📚: https://cpython-previews--141249.org.readthedocs.build/
Open Graph Description: Fixes issue #141186 by documenting that cancelling a Task cancels what it's waiting for. Problem The docs said cancelling a coroutine waiting on a Future cancels the Future, but didn't ment...
X Description: Fixes issue #141186 by documenting that cancelling a Task cancels what it's waiting for. Problem The docs said cancelling a coroutine waiting on a Future cancels the Future, but didn...
Opengraph URL: https://github.com/python/cpython/pull/141249
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:0a6e0888-1cf2-5c54-7e12-8b96d878a3f2 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A70A:7A340:C4E065:10B95FC:6A516A74 |
| html-safe-nonce | 33564941da95a2a0ce20845abb84ef36781fe839d9d9da4760fe1bad32bc3bb4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzBBOjdBMzQwOkM0RTA2NToxMEI5NUZDOjZBNTE2QTc0IiwidmlzaXRvcl9pZCI6IjM1MjU4NDIzMDEyMjA5MDc2MzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a79ef505a9d5e193cdf0046dfb33fe73a18456f9746d31184dec8c1d74b3fbc7 |
| hovercard-subject-tag | pull_request:2991498490 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/141249/files |
| twitter:image | https://avatars.githubusercontent.com/u/55545648?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/55545648?s=400&v=4 |
| og:image:alt | Fixes issue #141186 by documenting that cancelling a Task cancels what it's waiting for. Problem The docs said cancelling a coroutine waiting on a Future cancels the Future, but didn't ment... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 60eaaf6d4dbaa817031b556aebd8a0a7eeb81b97 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width