From fad29f3467a3902afdde2c4de1296cc297ecba79 Mon Sep 17 00:00:00 2001 From: CircuitSacul Date: Mon, 21 Mar 2022 15:06:01 -0400 Subject: [PATCH] Use slots for `_TaskWrapper` and `Callback` (#36) --- hikari_clusters/callbacks.py | 2 ++ hikari_clusters/task_manager.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/hikari_clusters/callbacks.py b/hikari_clusters/callbacks.py index 15a7960..403c955 100644 --- a/hikari_clusters/callbacks.py +++ b/hikari_clusters/callbacks.py @@ -53,6 +53,8 @@ class Callback: The clients that should be responding to this callback. """ + __slots__ = ("ipc", "key", "responders", "resps", "future") + def __init__(self, ipc: IpcClient, key: int, responders: Iterable[int]): self.ipc = ipc self.key = key diff --git a/hikari_clusters/task_manager.py b/hikari_clusters/task_manager.py index 5654647..564de1c 100644 --- a/hikari_clusters/task_manager.py +++ b/hikari_clusters/task_manager.py @@ -34,6 +34,8 @@ class _TaskWrapper: + __slots__ = ("allow_cancel", "allow_wait", "t") + def __init__( self, allow_cancel: bool, allow_wait: bool, t: asyncio.Task[Any] ) -> None: