summaryrefslogtreecommitdiff
path: root/Lib/asyncio/events.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-02-10 00:45:44 +0100
committerVictor Stinner <victor.stinner@gmail.com>2014-02-10 00:45:44 +0100
commitdc62b7e261ab88b4ab967ac2ae307eddbfa0ae09 (patch)
tree0c8878ba52ef21fb7058545b9ca62d1838cf9ccd /Lib/asyncio/events.py
parent136fea253e438a0db6a1d24d3c23f02fcb64b7c4 (diff)
downloadcpython-git-dc62b7e261ab88b4ab967ac2ae307eddbfa0ae09.tar.gz
asyncio: Tulip issue 112: Inline make_handle() into Handle constructor
Diffstat (limited to 'Lib/asyncio/events.py')
-rw-r--r--Lib/asyncio/events.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py
index 62400195a2..4c0cbb0917 100644
--- a/Lib/asyncio/events.py
+++ b/Lib/asyncio/events.py
@@ -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."""