Title: Improper call to `asyncio.Timeout.expired` · Issue #101498 · python/cpython · GitHub
Open Graph Title: Improper call to `asyncio.Timeout.expired` · Issue #101498 · python/cpython
X Title: Improper call to `asyncio.Timeout.expired` · Issue #101498 · python/cpython
Description: Documentation In this example for using asyncio.Timeout, expired is accessed as an attribute, but it should be called as a method. I.e. the example should read as: async def main(): try: # We do not know the timeout when starting, so we ...
Open Graph Description: Documentation In this example for using asyncio.Timeout, expired is accessed as an attribute, but it should be called as a method. I.e. the example should read as: async def main(): try: # We do no...
X Description: Documentation In this example for using asyncio.Timeout, expired is accessed as an attribute, but it should be called as a method. I.e. the example should read as: async def main(): try: # We do no...
Opengraph URL: https://github.com/python/cpython/issues/101498
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improper call to `asyncio.Timeout.expired`","articleBody":"# Documentation\r\n\r\nIn [this example](https://docs.python.org/3/library/asyncio-task.html#asyncio.Timeout) for using `asyncio.Timeout`, `expired` is accessed as an attribute, but it should be called as a method.\r\n\r\nI.e. the example should read as:\r\n\r\n```python\r\nasync def main():\r\n try:\r\n # We do not know the timeout when starting, so we pass ``None``.\r\n async with asyncio.timeout(None) as cm:\r\n # We know the timeout now, so we reschedule it.\r\n new_deadline = get_running_loop().time() + 10\r\n cm.reschedule(new_deadline)\r\n\r\n await long_running_task()\r\n except TimeoutError:\r\n pass\r\n\r\n if cm.expired(): # \u003c---- I CHANGED THIS TO BE A METHOD CALL\r\n print(\"Looks like we haven't finished on time.\")\r\n```\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-101499\n* gh-101501\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/rsokl","@type":"Person","name":"rsokl"},"datePublished":"2023-02-01T16:57:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/101498/cpython/issues/101498"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c62f0832-cc00-9ed7-a527-ca6979af5b90 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CC56:250A02:17E06BB:1FEA99B:6969AB8C |
| html-safe-nonce | 62499e9421a987662b9dfb795288f7e5b21e3f58d0ee563c46cebeb27c0ecfde |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQzU2OjI1MEEwMjoxN0UwNkJCOjFGRUE5OUI6Njk2OUFCOEMiLCJ2aXNpdG9yX2lkIjoiNzA1Njc3MjI1NTY5Mjk5MTM3MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | be46012ed56612deeb0e5d767990bbf44022487c7db161e1d1f49eb8ec84f991 |
| hovercard-subject-tag | issue:1566467725 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/python/cpython/101498/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bd62fc1a74173f2b5fbd995d9ff0a912ff85daaef56c72bce4d1a3a95d93ad2f/python/cpython/issues/101498 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bd62fc1a74173f2b5fbd995d9ff0a912ff85daaef56c72bce4d1a3a95d93ad2f/python/cpython/issues/101498 |
| og:image:alt | Documentation In this example for using asyncio.Timeout, expired is accessed as an attribute, but it should be called as a method. I.e. the example should read as: async def main(): try: # We do no... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rsokl |
| hostname | github.com |
| expected-hostname | github.com |
| None | 24c4c97a2d520cb286b35e1a4c22d7a4df3c26a2fa28dd7cdf0e65db327b4de7 |
| turbo-cache-control | no-preview |
| 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 | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 124667f43168afb6c9c03b7c02eb5b1d2e1be3d9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width