From 9934388d03ff6cee5302383cfd231c0e559f7ffa Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Sun, 20 Nov 2022 17:11:19 +0100 Subject: Type callback return type --- slack/util.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/slack/util.py b/slack/util.py index c6cb57d..112f060 100644 --- a/slack/util.py +++ b/slack/util.py @@ -1,11 +1,13 @@ -from typing import Any, Callable +from typing import Callable, Dict, Union import weechat from slack.shared import shared +weechat_callback_return_type = Union[int, str, Dict[str, str], None] -def get_callback_name(callback: Callable[..., Any]) -> str: + +def get_callback_name(callback: Callable[..., weechat_callback_return_type]) -> str: shared.weechat_callbacks[callback.__name__] = callback return callback.__name__ -- cgit