summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/events.py
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2014-02-12 22:01:52 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2014-02-12 22:01:52 (GMT)
commitb13177885f05f44f859e4bccfc0b551f1771a88b (patch)
tree010f5c5b8ee4b491f2bdd1d2f04a6bcdc398e244 /Lib/asyncio/events.py
parent9887fd7a7947bc3e53375a749171213d232b2e5c (diff)
downloadcpython-b13177885f05f44f859e4bccfc0b551f1771a88b.zip
cpython-b13177885f05f44f859e4bccfc0b551f1771a88b.tar.gz
cpython-b13177885f05f44f859e4bccfc0b551f1771a88b.tar.bz2
asyncio.events: Use __slots__ in Handle and TimerHandle
Diffstat (limited to 'Lib/asyncio/events.py')
-rw-r--r--Lib/asyncio/events.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py
index 4c0cbb0..dd9e3fb 100644
--- a/Lib/asyncio/events.py
+++ b/Lib/asyncio/events.py
@@ -19,6 +19,8 @@ from .log import logger
class Handle:
"""Object returned by callback registration methods."""
+ __slots__ = ['_callback', '_args', '_cancelled']
+
def __init__(self, callback, args):
assert not isinstance(callback, Handle), 'A Handle is not a callback'
self._callback = callback
@@ -46,6 +48,8 @@ class Handle:
class TimerHandle(Handle):
"""Object returned by timed callback registration methods."""
+ __slots__ = ['_when']
+
def __init__(self, when, callback, args):
assert when is not None
super().__init__(callback, args)