From da999e5312073a471dbf19d08b319c80cc7f97c4 Mon Sep 17 00:00:00 2001 From: lightdrk <108566237+lightdrk@users.noreply.github.com> Date: Tue, 27 Jun 2023 16:06:59 +0530 Subject: [PATCH 1/5] Update asyncio-task.rst correction of reference , asyncio.TimeoutError to TimeoutError . --- Doc/library/asyncio-task.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index 3618bcb6d7c6b5..46be55ca3f7d17 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -654,16 +654,16 @@ Timeouts If ``long_running_task`` takes more than 10 seconds to complete, the context manager will cancel the current task and handle the resulting :exc:`asyncio.CancelledError` internally, transforming it - into an :exc:`asyncio.TimeoutError` which can be caught and handled. + into an :exc:`TimeoutError` which can be caught and handled. .. note:: The :func:`asyncio.timeout` context manager is what transforms - the :exc:`asyncio.CancelledError` into an :exc:`asyncio.TimeoutError`, - which means the :exc:`asyncio.TimeoutError` can only be caught + the :exc:`asyncio.CancelledError` into an :exc:`TimeoutError`, + which means the :exc:`TimeoutError` can only be caught *outside* of the context manager. - Example of catching :exc:`asyncio.TimeoutError`:: + Example of catching :exc:`TimeoutError`:: async def main(): try: From 89ea49b6f83e35c67cb95b20870f57fd526139a6 Mon Sep 17 00:00:00 2001 From: lightdrk <108566237+lightdrk@users.noreply.github.com> Date: Tue, 27 Jun 2023 23:13:11 +0530 Subject: [PATCH 2/5] Update asyncio-task.rst --- Doc/library/asyncio-task.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index 46be55ca3f7d17..f5b946bc79129d 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -170,7 +170,7 @@ other coroutines:: In this documentation the term "coroutine" can be used for two closely related concepts: - * a *coroutine function*: an :keyword:`async def` function; + * a *coroutine function*: a :keyword:`async def` function; * a *coroutine object*: an object returned by calling a *coroutine function*. @@ -654,12 +654,12 @@ Timeouts If ``long_running_task`` takes more than 10 seconds to complete, the context manager will cancel the current task and handle the resulting :exc:`asyncio.CancelledError` internally, transforming it - into an :exc:`TimeoutError` which can be caught and handled. + into a :exc:`TimeoutError` which can be caught and handled. .. note:: The :func:`asyncio.timeout` context manager is what transforms - the :exc:`asyncio.CancelledError` into an :exc:`TimeoutError`, + the :exc:`asyncio.CancelledError` into a :exc:`TimeoutError`, which means the :exc:`TimeoutError` can only be caught *outside* of the context manager. @@ -838,7 +838,7 @@ Waiting Primitives +-----------------------------+----------------------------------------+ | :const:`FIRST_EXCEPTION` | The function will return when any | | | future finishes by raising an | - | | exception. If no future raises an | + | | exception. If no future raises a | | | exception then it is equivalent to | | | :const:`ALL_COMPLETED`. | +-----------------------------+----------------------------------------+ @@ -862,7 +862,7 @@ Waiting Primitives .. function:: as_completed(aws, *, timeout=None) Run :ref:`awaitable objects ` in the *aws* - iterable concurrently. Return an iterator of coroutines. + iterable concurrently. Return a iterator of coroutines. Each coroutine returned can be awaited to get the earliest next result from the iterable of the remaining awaitables. @@ -1121,7 +1121,7 @@ Task Object If the Task has been *cancelled*, this method raises a :exc:`CancelledError` exception. - If the Task isn't *done* yet, this method raises an + If the Task isn't *done* yet, this method raises a :exc:`InvalidStateError` exception. .. method:: add_done_callback(callback, *, context=None) From 0a2e074b0f87de65e3cee83068483ab3bde1b5d2 Mon Sep 17 00:00:00 2001 From: lightdrk <108566237+lightdrk@users.noreply.github.com> Date: Tue, 27 Jun 2023 23:16:58 +0530 Subject: [PATCH 3/5] Update asyncio-task.rst --- Doc/library/asyncio-task.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index f5b946bc79129d..51f8b31b95782e 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -838,7 +838,7 @@ Waiting Primitives +-----------------------------+----------------------------------------+ | :const:`FIRST_EXCEPTION` | The function will return when any | | | future finishes by raising an | - | | exception. If no future raises a | + | | exception. If no future raises an | | | exception then it is equivalent to | | | :const:`ALL_COMPLETED`. | +-----------------------------+----------------------------------------+ @@ -862,7 +862,7 @@ Waiting Primitives .. function:: as_completed(aws, *, timeout=None) Run :ref:`awaitable objects ` in the *aws* - iterable concurrently. Return a iterator of coroutines. + iterable concurrently. Return an iterator of coroutines. Each coroutine returned can be awaited to get the earliest next result from the iterable of the remaining awaitables. From e43e355c410d8e4dfd8219ba72078cd6d4ed50d8 Mon Sep 17 00:00:00 2001 From: lightdrk <108566237+lightdrk@users.noreply.github.com> Date: Tue, 27 Jun 2023 23:26:16 +0530 Subject: [PATCH 4/5] Update Doc/library/asyncio-task.rst Co-authored-by: Hugo van Kemenade --- Doc/library/asyncio-task.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index 51f8b31b95782e..12c79d89da509e 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -170,7 +170,7 @@ other coroutines:: In this documentation the term "coroutine" can be used for two closely related concepts: - * a *coroutine function*: a :keyword:`async def` function; + * a *coroutine function*: an :keyword:`async def` function; * a *coroutine object*: an object returned by calling a *coroutine function*. From b687b77b9fc07e0d935c7c50db5dc87c1b0f15d9 Mon Sep 17 00:00:00 2001 From: lightdrk <108566237+lightdrk@users.noreply.github.com> Date: Tue, 27 Jun 2023 23:27:03 +0530 Subject: [PATCH 5/5] Update Doc/library/asyncio-task.rst Co-authored-by: Hugo van Kemenade --- Doc/library/asyncio-task.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index 12c79d89da509e..0651ff7213e527 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -1121,7 +1121,7 @@ Task Object If the Task has been *cancelled*, this method raises a :exc:`CancelledError` exception. - If the Task isn't *done* yet, this method raises a + If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` exception. .. method:: add_done_callback(callback, *, context=None)