mirror of
https://github.com/python/cpython.git
synced 2025-08-31 22:18:28 +00:00
asyncio: Tulip issue 112: Inline make_handle() into Handle constructor
This commit is contained in:
parent
136fea253e
commit
dc62b7e261
6 changed files with 9 additions and 14 deletions
|
@ -20,6 +20,7 @@ class Handle:
|
|||
"""Object returned by callback registration methods."""
|
||||
|
||||
def __init__(self, callback, args):
|
||||
assert not isinstance(callback, Handle), 'A Handle is not a callback'
|
||||
self._callback = callback
|
||||
self._args = args
|
||||
self._cancelled = False
|
||||
|
@ -42,12 +43,6 @@ class Handle:
|
|||
self = None # Needed to break cycles when an exception occurs.
|
||||
|
||||
|
||||
def make_handle(callback, args):
|
||||
# TODO: Inline this? Or make it a private EventLoop method?
|
||||
assert not isinstance(callback, Handle), 'A Handle is not a callback'
|
||||
return Handle(callback, args)
|
||||
|
||||
|
||||
class TimerHandle(Handle):
|
||||
"""Object returned by timed callback registration methods."""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue