aboutsummaryrefslogtreecommitdiffstats
path: root/slack/util.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2023-01-29 20:02:53 +0100
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-18 11:32:53 +0100
commit1db04ff63d4f62f88f0e56bd0233290ef7c9dd95 (patch)
treeb1bc647d2e5bf563881ce820d2376965336ab335 /slack/util.py
parent6ca6e00bda3259d83f69d831093fe124c4c31f47 (diff)
downloadwee-slack-1db04ff63d4f62f88f0e56bd0233290ef7c9dd95.tar.gz
Replace some usages of Any with proper types
Diffstat (limited to 'slack/util.py')
-rw-r--r--slack/util.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/slack/util.py b/slack/util.py
index 8738748..8dfc967 100644
--- a/slack/util.py
+++ b/slack/util.py
@@ -1,15 +1,13 @@
from __future__ import annotations
-from typing import Callable, Dict, Union
+from typing import Callable
import weechat
-from slack.shared import shared
+from slack.shared import WeechatCallbackReturnType, shared
-weechat_callback_return_type = Union[int, str, Dict[str, str], None]
-
-def get_callback_name(callback: Callable[..., weechat_callback_return_type]) -> str:
+def get_callback_name(callback: Callable[..., WeechatCallbackReturnType]) -> str:
callback_id = f"{callback.__name__}-{id(callback)}"
shared.weechat_callbacks[callback_id] = callback
return callback_id