diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2014-02-12 22:01:52 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2014-02-12 22:01:52 (GMT) |
commit | ee6dc425c895755c9fe27dee10e52e762b420c7b (patch) | |
tree | 20110f9d12ddc013c3d7bdf5eab9faa90d76b6f7 /Lib | |
parent | 85489f903142f435811114820bc32c24d34fd6c4 (diff) | |
download | cpython-ee6dc425c895755c9fe27dee10e52e762b420c7b.zip cpython-ee6dc425c895755c9fe27dee10e52e762b420c7b.tar.gz cpython-ee6dc425c895755c9fe27dee10e52e762b420c7b.tar.bz2 |
asyncio.events: Use __slots__ in Handle and TimerHandle
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/asyncio/events.py | 4 |
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) |