Issue 35826: Typo in example for async with statement with condition (original) (raw)

Created on 2019-01-25 10:44 by mhchia, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 11681 merged mhchia,2019-01-26 05:54
PR 11681 merged mhchia,2019-01-26 05:54
PR 11681 merged mhchia,2019-01-26 05:54
PR 11681 merged mhchia,2019-01-26 05:54
PR 16720 merged miss-islington,2019-10-11 17:24
Messages (5)
msg334349 - (view) Author: Kevin Mai-Hsuan Chia (mhchia) * Date: 2019-01-25 10:44
In the [example](https://docs.python.org/3.8/library/asyncio-sync.html#asyncio.Condition) of the equivalent code to the `async with statement`: ```python cond = asyncio.Condition() # ... later await lock.acquire() try: await cond.wait() finally: lock.release() ``` `lock.acquire()` should be replaced by `cond.acquire()`, and `lock.release()` replaced by `cond.release()`. So the resulting code snippet becomes: ```python cond = asyncio.Condition() # ... later await cond.acquire() try: await cond.wait() finally: cond.release() ```
msg334350 - (view) Author: Kevin Mai-Hsuan Chia (mhchia) * Date: 2019-01-25 10:45
In the [example](https://docs.python.org/3.8/library/asyncio-sync.html#asyncio.Condition) of the equivalent code to the `async with` statement: ```python cond = asyncio.Condition() # ... later await lock.acquire() try: await cond.wait() finally: lock.release() ``` `lock.acquire()` should be replaced by `cond.acquire()`, and `lock.release()` replaced by `cond.release()`. So the resulting code snippet becomes: ```python cond = asyncio.Condition() # ... later await cond.acquire() try: await cond.wait() finally: cond.release() ```
msg334376 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2019-01-25 23:10
Please submit a PR!
msg336310 - (view) Author: Emmanuel Arias (eamanu) * Date: 2019-02-22 13:48
This issue could be closed, right?
msg336318 - (view) Author: Kevin Mai-Hsuan Chia (mhchia) * Date: 2019-02-22 14:44
Cool! Thanks for the reminder.
History
Date User Action Args
2022-04-11 14:59:10 admin set github: 80007
2019-10-11 17:24:08 miss-islington set pull_requests: + <pull%5Frequest16297>
2019-02-22 14:44:26 mhchia set status: open -> closedmessages: + stage: patch review -> resolved
2019-02-22 13:48:48 eamanu set nosy: + eamanumessages: +
2019-01-26 05:55:05 mhchia set keywords: + patchstage: patch reviewpull_requests: + <pull%5Frequest11513>
2019-01-26 05:54:58 mhchia set keywords: + patchstage: (no value)pull_requests: + <pull%5Frequest11514>
2019-01-26 05:54:50 mhchia set keywords: + patchstage: (no value)pull_requests: + <pull%5Frequest11512>
2019-01-26 05:54:41 mhchia set keywords: + patchstage: (no value)pull_requests: + <pull%5Frequest11511>
2019-01-25 23:45:50 willingc set nosy: + willingc
2019-01-25 23:10:28 yselivanov set nosy: + asvetlov, yselivanovmessages: + components: + asyncio, - Documentationkeywords: + easy
2019-01-25 10:45:14 mhchia set messages: +
2019-01-25 10:44:12 mhchia create