From 8ffedc39beb022142b98bfbd3700d9256fde66d5 Mon Sep 17 00:00:00 2001 From: Roger Iyengar Date: Mon, 15 Jun 2020 01:32:58 -0400 Subject: [PATCH 01/15] Update asyncio-eventloop.rst --- Doc/library/asyncio-eventloop.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index d60a6ce95cdd87..c4c80ad584b55a 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -196,6 +196,9 @@ Scheduling callbacks Callbacks are called in the order in which they are registered. Each callback will be called exactly once. + + A callback is a standard Python function. Passing a coroutine to + as callback will result in an error. An optional keyword-only *context* argument allows specifying a custom :class:`contextvars.Context` for the *callback* to run in. From 305ad6f67c191271d020867f0815e3aaa37687a1 Mon Sep 17 00:00:00 2001 From: Roger Iyengar Date: Mon, 15 Jun 2020 01:36:49 -0400 Subject: [PATCH 02/15] Update asyncio-eventloop.rst --- Doc/library/asyncio-eventloop.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index c4c80ad584b55a..add564b9892c43 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -197,8 +197,8 @@ Scheduling callbacks Callbacks are called in the order in which they are registered. Each callback will be called exactly once. - A callback is a standard Python function. Passing a coroutine to - as callback will result in an error. + A callback is a standard Python function. Passing a coroutine + as the `callback` argument will result in an error. An optional keyword-only *context* argument allows specifying a custom :class:`contextvars.Context` for the *callback* to run in. From 084bbc53b323e0482cd6eec3664b80c78f0a742c Mon Sep 17 00:00:00 2001 From: Roger Iyengar Date: Mon, 15 Jun 2020 01:39:36 -0400 Subject: [PATCH 03/15] Update asyncio-eventloop.rst --- Doc/library/asyncio-eventloop.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index add564b9892c43..6da0c5f6894c7a 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -198,7 +198,7 @@ Scheduling callbacks Each callback will be called exactly once. A callback is a standard Python function. Passing a coroutine - as the `callback` argument will result in an error. + as the *callback* argument will result in an error. An optional keyword-only *context* argument allows specifying a custom :class:`contextvars.Context` for the *callback* to run in. From 97b04a3121f801bbef501edd1a29789a9c506e42 Mon Sep 17 00:00:00 2001 From: Roger Iyengar Date: Mon, 15 Jun 2020 01:41:44 -0400 Subject: [PATCH 04/15] Update asyncio-eventloop.rst --- Doc/library/asyncio-eventloop.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 6da0c5f6894c7a..d0d4370bc6f083 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -196,7 +196,7 @@ Scheduling callbacks Callbacks are called in the order in which they are registered. Each callback will be called exactly once. - + A callback is a standard Python function. Passing a coroutine as the *callback* argument will result in an error. From d1a435a5b7ddde63a617179266d9357f9cb28bb6 Mon Sep 17 00:00:00 2001 From: Roger Iyengar Date: Thu, 18 Jun 2020 21:14:32 -0400 Subject: [PATCH 05/15] Update asyncio-eventloop.rst --- Doc/library/asyncio-eventloop.rst | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index d0d4370bc6f083..4b21fb8154758d 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -191,15 +191,12 @@ Scheduling callbacks .. method:: loop.call_soon(callback, *args, context=None) - Schedule a *callback* to be called with *args* arguments at - the next iteration of the event loop. + Schedule a non-async *callback* to be called with *args* + arguments at the next iteration of the event loop. Callbacks are called in the order in which they are registered. Each callback will be called exactly once. - A callback is a standard Python function. Passing a coroutine - as the *callback* argument will result in an error. - An optional keyword-only *context* argument allows specifying a custom :class:`contextvars.Context` for the *callback* to run in. The current context is used when no *context* is provided. From 36936b6cab29fa30e47e4a385e39f9eca5c34d7d Mon Sep 17 00:00:00 2001 From: Roger Iyengar Date: Thu, 18 Jun 2020 21:15:07 -0400 Subject: [PATCH 06/15] Update asyncio-dev.rst --- Doc/library/asyncio-dev.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/asyncio-dev.rst b/Doc/library/asyncio-dev.rst index ff51c4fa3b20f4..a6152b6765ac89 100644 --- a/Doc/library/asyncio-dev.rst +++ b/Doc/library/asyncio-dev.rst @@ -73,7 +73,7 @@ event loop, no other Tasks can run in the same thread. When a Task executes an ``await`` expression, the running Task gets suspended, and the event loop executes the next Task. -To schedule a callback from a different OS thread, the +To schedule a non-async callback from a different OS thread, the :meth:`loop.call_soon_threadsafe` method should be used. Example:: loop.call_soon_threadsafe(callback, *args) From bf275d3ee9d74e31ba7033f2931577292d90f394 Mon Sep 17 00:00:00 2001 From: Roger Iyengar Date: Thu, 18 Jun 2020 21:21:03 -0400 Subject: [PATCH 07/15] Update asyncio-dev.rst --- Doc/library/asyncio-dev.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/asyncio-dev.rst b/Doc/library/asyncio-dev.rst index a6152b6765ac89..fd49f5fa8ed2d4 100644 --- a/Doc/library/asyncio-dev.rst +++ b/Doc/library/asyncio-dev.rst @@ -73,7 +73,7 @@ event loop, no other Tasks can run in the same thread. When a Task executes an ``await`` expression, the running Task gets suspended, and the event loop executes the next Task. -To schedule a non-async callback from a different OS thread, the +To schedule a synchronous callback from a different OS thread, the :meth:`loop.call_soon_threadsafe` method should be used. Example:: loop.call_soon_threadsafe(callback, *args) From 1da85795d6e120ff38a506692cfba0e7b8d3b87c Mon Sep 17 00:00:00 2001 From: Roger Iyengar Date: Thu, 18 Jun 2020 21:21:22 -0400 Subject: [PATCH 08/15] Update asyncio-eventloop.rst --- Doc/library/asyncio-eventloop.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 4b21fb8154758d..849ce9d33564eb 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -191,7 +191,7 @@ Scheduling callbacks .. method:: loop.call_soon(callback, *args, context=None) - Schedule a non-async *callback* to be called with *args* + Schedule a synchronous *callback* to be called with *args* arguments at the next iteration of the event loop. Callbacks are called in the order in which they are registered. From f436584234029dbdfc74538d80b3ab0aca3a2b9e Mon Sep 17 00:00:00 2001 From: Roger Iyengar Date: Fri, 19 Jun 2020 12:32:09 -0400 Subject: [PATCH 09/15] Update glossary.rst --- Doc/glossary.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Doc/glossary.rst b/Doc/glossary.rst index 6189cb045049c2..d750829bf512b2 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -189,6 +189,10 @@ Glossary A list of bytecode instructions can be found in the documentation for :ref:`the dis module `. + callback + A subroutine function which is passed as an argument to be executed at + some point in the future. + class A template for creating user-defined objects. Class definitions normally contain method definitions which operate on instances of the From f5b7a7e4298cbd90dcbd62c1721bc0278c88398e Mon Sep 17 00:00:00 2001 From: Roger Iyengar Date: Fri, 19 Jun 2020 12:37:49 -0400 Subject: [PATCH 10/15] Update asyncio-eventloop.rst --- Doc/library/asyncio-eventloop.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 849ce9d33564eb..f16e35080b6779 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -191,8 +191,8 @@ Scheduling callbacks .. method:: loop.call_soon(callback, *args, context=None) - Schedule a synchronous *callback* to be called with *args* - arguments at the next iteration of the event loop. + Schedule the *callback* :ref:`callback ` to be called with + *args* arguments at the next iteration of the event loop. Callbacks are called in the order in which they are registered. Each callback will be called exactly once. From 57a50e468296da72361568544487142ee33582db Mon Sep 17 00:00:00 2001 From: Roger Iyengar Date: Fri, 19 Jun 2020 12:40:21 -0400 Subject: [PATCH 11/15] Update asyncio-dev.rst --- Doc/library/asyncio-dev.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/asyncio-dev.rst b/Doc/library/asyncio-dev.rst index fd49f5fa8ed2d4..129e03677165fe 100644 --- a/Doc/library/asyncio-dev.rst +++ b/Doc/library/asyncio-dev.rst @@ -73,8 +73,8 @@ event loop, no other Tasks can run in the same thread. When a Task executes an ``await`` expression, the running Task gets suspended, and the event loop executes the next Task. -To schedule a synchronous callback from a different OS thread, the -:meth:`loop.call_soon_threadsafe` method should be used. Example:: +To schedule a :ref:`callback ` from a different OS thread, +the :meth:`loop.call_soon_threadsafe` method should be used. Example:: loop.call_soon_threadsafe(callback, *args) From 16979009958d989b3df73858b4f1cfe28f25abf0 Mon Sep 17 00:00:00 2001 From: Roger Iyengar Date: Fri, 19 Jun 2020 13:01:39 -0400 Subject: [PATCH 12/15] Update asyncio-dev.rst --- Doc/library/asyncio-dev.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/asyncio-dev.rst b/Doc/library/asyncio-dev.rst index 129e03677165fe..507834dddd60b9 100644 --- a/Doc/library/asyncio-dev.rst +++ b/Doc/library/asyncio-dev.rst @@ -73,8 +73,8 @@ event loop, no other Tasks can run in the same thread. When a Task executes an ``await`` expression, the running Task gets suspended, and the event loop executes the next Task. -To schedule a :ref:`callback ` from a different OS thread, -the :meth:`loop.call_soon_threadsafe` method should be used. Example:: +To schedule a :term:`callback` from a different OS thread, the +:meth:`loop.call_soon_threadsafe` method should be used. Example:: loop.call_soon_threadsafe(callback, *args) From 61dc89641ffe85d3f78facdaf3a3ceab731b8273 Mon Sep 17 00:00:00 2001 From: Roger Iyengar Date: Fri, 19 Jun 2020 13:03:54 -0400 Subject: [PATCH 13/15] Update asyncio-eventloop.rst --- Doc/library/asyncio-eventloop.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index f16e35080b6779..b1e73189a7a4cf 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -191,7 +191,7 @@ Scheduling callbacks .. method:: loop.call_soon(callback, *args, context=None) - Schedule the *callback* :ref:`callback ` to be called with + Schedule the *callback* :term:`callback` to be called with *args* arguments at the next iteration of the event loop. Callbacks are called in the order in which they are registered. From ec4e0c680e0958aa0c60611691873b19c60406dc Mon Sep 17 00:00:00 2001 From: Roger Iyengar Date: Fri, 19 Jun 2020 13:36:08 -0400 Subject: [PATCH 14/15] Fix trailing whitespace error --- Doc/glossary.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/glossary.rst b/Doc/glossary.rst index d750829bf512b2..e997d366777b38 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -190,7 +190,7 @@ Glossary :ref:`the dis module `. callback - A subroutine function which is passed as an argument to be executed at + A subroutine function which is passed as an argument to be executed at some point in the future. class From fce21c790f3898cefd0de2fb693d9b73312a4fea Mon Sep 17 00:00:00 2001 From: Roger Iyengar Date: Mon, 22 Jun 2020 15:46:23 -0400 Subject: [PATCH 15/15] Update Doc/library/asyncio-dev.rst Co-authored-by: Yury Selivanov --- Doc/library/asyncio-dev.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/asyncio-dev.rst b/Doc/library/asyncio-dev.rst index 507834dddd60b9..77f80671978369 100644 --- a/Doc/library/asyncio-dev.rst +++ b/Doc/library/asyncio-dev.rst @@ -73,7 +73,7 @@ event loop, no other Tasks can run in the same thread. When a Task executes an ``await`` expression, the running Task gets suspended, and the event loop executes the next Task. -To schedule a :term:`callback` from a different OS thread, the +To schedule a :term:`callback` from another OS thread, the :meth:`loop.call_soon_threadsafe` method should be used. Example:: loop.call_soon_threadsafe(callback, *args)