]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Reflect 'context' arg in 'AbstractEventLoop.call_*()' methods (GH-30427)
authorAndrew Svetlov <andrew.svetlov@gmail.com>
Thu, 6 Jan 2022 12:31:32 +0000 (14:31 +0200)
committerGitHub <noreply@github.com>
Thu, 6 Jan 2022 12:31:32 +0000 (14:31 +0200)
Lib/asyncio/events.py
Misc/NEWS.d/next/Library/2022-01-06-13-38-00.bpo-46278.wILA80.rst [new file with mode: 0644]

index d91fe8db2b02044fde9ce335ee85b0b8d93134e4..831c19cf0ec683b234a6c04f7582096ef5425dc2 100644 (file)
@@ -257,13 +257,13 @@ class AbstractEventLoop:
         """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):
@@ -279,7 +279,7 @@ class AbstractEventLoop:
 
     # 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 (file)
index 0000000..4084904
--- /dev/null
@@ -0,0 +1,2 @@
+Reflect ``context`` argument in ``AbstractEventLoop.call_*()`` methods. Loop
+implementations already support it.