[docs] [issue35826] Typo in example for async with statement with condition

Kevin Mai-Hsuan Chia report at bugs.python.org
Fri Jan 25 05:44:16 EST 2019


New submission from Kevin Mai-Hsuan Chia <kevin at mhchia.com>:

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()
```

----------
assignee: docs at python
components: Documentation
messages: 334349
nosy: docs at python, mhchia
priority: normal
severity: normal
status: open
title: Typo in example for async with statement with condition
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35826>
_______________________________________


More information about the docs mailing list