Browse Source

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

(cherry picked from commit 3e43fac250)

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

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
pull/30431/head
Miss Islington (bot) 4 years ago
committed by GitHub
parent
commit
8670fbe4d2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      Lib/asyncio/events.py
  2. 2
      Misc/NEWS.d/next/Library/2022-01-06-13-38-00.bpo-46278.wILA80.rst

8
Lib/asyncio/events.py

@ -258,13 +258,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):
@ -280,7 +280,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):

2
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.
Loading…
Cancel
Save