[Python-checkins] Reflect 'context' arg in 'AbstractEventLoop.call_*()' methods (GH-30427) (GH-30428)

asvetlov webhook-mailer at python.org
Thu Jan 6 08:04:09 EST 2022


https://github.com/python/cpython/commit/8670fbe4d2503ab9d3467d859fa504d1dd6c6eec
commit: 8670fbe4d2503ab9d3467d859fa504d1dd6c6eec
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: asvetlov <andrew.svetlov at gmail.com>
date: 2022-01-06T15:04:05+02:00
summary:

Reflect 'context' arg in 'AbstractEventLoop.call_*()' methods (GH-30427) (GH-30428)

(cherry picked from commit 3e43fac2503afe219336742b150b3ef6e470686f)

Co-authored-by: Andrew Svetlov <andrew.svetlov at gmail.com>

Co-authored-by: Andrew Svetlov <andrew.svetlov at gmail.com>

files:
A Misc/NEWS.d/next/Library/2022-01-06-13-38-00.bpo-46278.wILA80.rst
M Lib/asyncio/events.py

diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py
index 7abaaca2d2b28..58236059f7e22 100644
--- a/Lib/asyncio/events.py
+++ b/Lib/asyncio/events.py
@@ -258,13 +258,13 @@ def _timer_handle_cancelled(self, handle):
         """Notification that a TimerHandle has been cancelled."""
         raise NotImplementedError
 
-    def call_soon(self, callback, *args):
+    def call_soon(self, callback, *args, context=None):
         return self.call_later(0, callback, *args)
 
-    def call_later(self, delay, callback, *args):
+    def call_later(self, delay, callback, *args, context=None):
         raise NotImplementedError
 
-    def call_at(self, when, callback, *args):
+    def call_at(self, when, callback, *args, cotext=None):
         raise NotImplementedError
 
     def time(self):
@@ -280,7 +280,7 @@ def create_task(self, coro, *, name=None):
 
     # Methods for interacting with threads.
 
-    def call_soon_threadsafe(self, callback, *args):
+    def call_soon_threadsafe(self, callback, *args, context=None):
         raise NotImplementedError
 
     def run_in_executor(self, executor, func, *args):
diff --git a/Misc/NEWS.d/next/Library/2022-01-06-13-38-00.bpo-46278.wILA80.rst b/Misc/NEWS.d/next/Library/2022-01-06-13-38-00.bpo-46278.wILA80.rst
new file mode 100644
index 0000000000000..40849044cf1c8
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2022-01-06-13-38-00.bpo-46278.wILA80.rst
@@ -0,0 +1,2 @@
+Reflect ``context`` argument in ``AbstractEventLoop.call_*()`` methods. Loop
+implementations already support it.



More information about the Python-checkins mailing list