diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2022-11-20 17:11:19 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:53 +0100 |
commit | 9934388d03ff6cee5302383cfd231c0e559f7ffa (patch) | |
tree | 454c4ef4e3089ee191f7b780eac9bf8e672d2cf3 | |
parent | aa8a08d18e1f73fb4371356c36a6a62f63202112 (diff) | |
download | wee-slack-9934388d03ff6cee5302383cfd231c0e559f7ffa.tar.gz |
Type callback return type
-rw-r--r-- | slack/util.py | 6 |
1 files 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__ |