diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-02-09 23:45:44 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-02-09 23:45:44 (GMT) |
commit | dc62b7e261ab88b4ab967ac2ae307eddbfa0ae09 (patch) | |
tree | 0c8878ba52ef21fb7058545b9ca62d1838cf9ccd /Lib/asyncio/events.py | |
parent | 136fea253e438a0db6a1d24d3c23f02fcb64b7c4 (diff) | |
download | cpython-dc62b7e261ab88b4ab967ac2ae307eddbfa0ae09.zip cpython-dc62b7e261ab88b4ab967ac2ae307eddbfa0ae09.tar.gz cpython-dc62b7e261ab88b4ab967ac2ae307eddbfa0ae09.tar.bz2 |
asyncio: Tulip issue 112: Inline make_handle() into Handle constructor
Diffstat (limited to 'Lib/asyncio/events.py')
-rw-r--r-- | Lib/asyncio/events.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py index 6240019..4c0cbb0 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.""" |