From 23354d030b433103f022b1a961dfd3102e035a11 Mon Sep 17 00:00:00 2001 From: Zomatree <39768508+Zomatree@users.noreply.github.com> Date: Mon, 26 Sep 2022 01:26:03 +0100 Subject: [PATCH] make metaclass not generic --- revolt/ext/commands/client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/revolt/ext/commands/client.py b/revolt/ext/commands/client.py index e6faac0..1c828d1 100755 --- a/revolt/ext/commands/client.py +++ b/revolt/ext/commands/client.py @@ -34,11 +34,11 @@ class ExtensionProtocol(Protocol): def setup(client: CommandsClient) -> None: raise NotImplementedError -class CommandsMeta(type, Generic[ClientT]): - _commands: list[Command[ClientT]] +class CommandsMeta(type): + _commands: list[Command[Any]] def __new__(cls, name: str, bases: tuple[type, ...], attrs: dict[str, Any]): - commands: list[Command[ClientT]] = [] + commands: list[Command[Any]] = [] self = super().__new__(cls, name, bases, attrs) for base in reversed(self.__mro__): for value in base.__dict__.values(): @@ -75,7 +75,7 @@ class CaseInsensitiveDict(dict[str, V]): super().__delitem__(key.casefold()) -class CommandsClient(revolt.Client, metaclass=CommandsMeta[Self]): +class CommandsClient(revolt.Client, metaclass=CommandsMeta): """Main class that adds commands, this class should be subclassed along with `revolt.Client`.""" _commands: list[Command[Self]]