From 0feca942a8056ce8093ea4ad798231d3e0565f38 Mon Sep 17 00:00:00 2001 From: hypergonial <46067571+hypergonial@users.noreply.github.com> Date: Sun, 7 Jan 2024 21:42:38 +0100 Subject: [PATCH] Fix docstrings --- arc/client.py | 6 +++--- arc/internal/sigparse.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arc/client.py b/arc/client.py index 1613c17..6f56b7a 100644 --- a/arc/client.py +++ b/arc/client.py @@ -146,7 +146,7 @@ def subscribe(self, event_type: type[EventT], callback: EventCallbackT[EventT]) The event type to subscribe to. `EventT` must be a subclass of `hikari.events.base_events.Event`. - callback : t.Callable[t.Concatenate[EventT, ...], t.Awaitable[None]] + callback : t.Callable[EventT], t.Awaitable[None]] The callback to call when the event is dispatched. """ self.app.event_manager.subscribe(event_type, callback) # pyright: ignore reportGeneralTypeIssues @@ -158,7 +158,7 @@ def unsubscribe(self, event_type: type[EventT], callback: EventCallbackT[EventT] ---------- event_type : type[EventT] The event type to unsubscribe from. - callback : t.Callable[t.Concatenate[EventT, ...], t.Awaitable[None]] + callback : t.Callable[[EventT], t.Awaitable[None]] The callback to unsubscribe. """ self.app.event_manager.unsubscribe(event_type, callback) # pyright: ignore reportGeneralTypeIssues @@ -178,7 +178,7 @@ def listen(self, *event_types: t.Type[EventT]) -> t.Callable[[EventCallbackT[Eve Returns ------- - t.Callable[t.Callable[t.Concatenate[EventT, ...], t.Awaitable[None]]], t.Callable[t.Concatenate[EventT, ...], t.Awaitable[None]]] + t.Callable[t.Callable[[EventT], t.Awaitable[None]]], t.Callable[[EventT], t.Awaitable[None]]] A decorator for a coroutine function that passes it to `EventManager.subscribe` before returning the function reference. diff --git a/arc/internal/sigparse.py b/arc/internal/sigparse.py index 9adc15f..eb4a07e 100644 --- a/arc/internal/sigparse.py +++ b/arc/internal/sigparse.py @@ -366,7 +366,7 @@ def parse_command_signature( # noqa: C901 return options -def parse_event_signature(func: t.Callable[t.Concatenate[EventT, ...], t.Awaitable[None]]) -> list[type[EventT]]: +def parse_event_signature(func: t.Callable[[EventT], t.Awaitable[None]]) -> list[type[EventT]]: """Parse an event callback function's signature and return the event type, ignore other type hints.""" hints = t.get_type_hints(func)