Skip to content

Commit 0e202cc

Browse files
committed
Doc review
1 parent 4e1ae75 commit 0e202cc

1 file changed

Lines changed: 23 additions & 19 deletions

File tree

examples/async.py

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626

2727
### async_basics: Basics
2828
# Use :meth:`Connection.as_async` to get an async connection, and
29-
# async for to iterate results. We also apply :doc:`best practice
30-
# <bestpractice>` and use :func:`contextlib.aclosing` to ensure the
31-
# database is closed while the event loop is still running.
29+
# :code:`async for` to iterate results. We also apply :doc:`best
30+
# practice <bestpractice>` and use :func:`contextlib.aclosing` to
31+
# ensure the database is closed.
3232

3333
apsw.bestpractice.apply(apsw.bestpractice.recommended)
3434

@@ -132,12 +132,14 @@ async def callbacks():
132132
# any fail, then cancel uncompleted ones, and raise the resulting
133133
# exceptions.
134134
#
135-
# * :external+python:ref:`except * <except_star>` and
136-
# :class:`ExceptionGroup` Python syntax for catching multiple
137-
# exceptions such as from a group of tasks
138-
# * :class:`asyncio.TaskGroup`
139-
# * :external+trio:ref:`Trio tasks <tasks>`
140-
# * :external+anyio:doc:`AnyIO tasks <tasks>`
135+
# .. seealso::
136+
#
137+
# * :external+python:ref:`except * <except_star>` and
138+
# :class:`ExceptionGroup` - Python syntax for catching multiple
139+
# exceptions such as from a group of tasks
140+
# * :class:`asyncio.TaskGroup`
141+
# * :external+trio:ref:`Trio tasks <tasks>`
142+
# * :external+anyio:doc:`AnyIO tasks <tasks>`
141143
#
142144
# This example shows asyncio, but the principles are the same across
143145
# all the frameworks.
@@ -231,15 +233,17 @@ async def deliberate_error():
231233
# deadlines for each framework, getting their current time, and
232234
# exceptions raised on timeout.
233235
#
234-
# * :meth:`asyncio.get_running_loop().time() <asyncio.loop.time>`
235-
# * :exc:`TimeoutError`
236-
# * :exc:`trio.TooSlowError`
237-
# * :func:`trio.current_time`
238-
# * :func:`trio.current_effective_deadline`
239-
# * :func:`trio.fail_after` :func:`trio.fail_at`
240-
# * :func:`anyio.current_time`
241-
# * :func:`anyio.current_effective_deadline`
242-
# * :func:`anyio.fail_after`
236+
# .. seealso::
237+
#
238+
# * :meth:`asyncio.get_running_loop().time() <asyncio.loop.time>`
239+
# * :exc:`TimeoutError`
240+
# * :exc:`trio.TooSlowError`
241+
# * :func:`trio.current_time`
242+
# * :func:`trio.current_effective_deadline`
243+
# * :func:`trio.fail_after` :func:`trio.fail_at`
244+
# * :func:`anyio.current_time`
245+
# * :func:`anyio.current_effective_deadline`
246+
# * :func:`anyio.fail_after`
243247

244248

245249
# The query is not reproduced here but is used when running this
@@ -409,7 +413,7 @@ async def virtual_tables():
409413
):
410414
print(row)
411415

412-
# SQLite will do the query work
416+
# SQLite will figure out the review and order work
413417
async for row in await db.execute(
414418
"SELECT * FROM books WHERE server=? AND flags=?AND review > 9.55 "
415419
" ORDER BY year DESC",

0 commit comments

Comments
 (0)