From: Yury Selivanov Date: Wed, 12 Feb 2014 22:01:52 +0000 (-0500) Subject: asyncio.events: Use __slots__ in Handle and TimerHandle X-Git-Tag: v3.4.0rc2~60 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b13177885f05f44f859e4bccfc0b551f1771a88b;p=thirdparty%2FPython%2Fcpython.git asyncio.events: Use __slots__ in Handle and TimerHandle --- diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py index 4c0cbb091768..dd9e3fb42992 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)