projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9887fd7
)
asyncio.events: Use __slots__ in Handle and TimerHandle
author
Yury Selivanov
<yselivanov@sprymix.com>
Wed, 12 Feb 2014 22:01:52 +0000
(17:01 -0500)
committer
Yury Selivanov
<yselivanov@sprymix.com>
Wed, 12 Feb 2014 22:01:52 +0000
(17:01 -0500)
Lib/asyncio/events.py
patch
|
blob
|
history
diff --git
a/Lib/asyncio/events.py
b/Lib/asyncio/events.py
index 4c0cbb091768bccd62f13c33e65d97f6c8e7ea8f..dd9e3fb42992df2e5fdf2157cc5532abb94de74f 100644
(file)
--- 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)