diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-02-07 20:12:04 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:53 +0100 |
commit | b3a378462ba3f7851c4e4d8f63c781f8d498290d (patch) | |
tree | d767546a90f6605e05f6d03cafc3fa6e338521c7 /slack/config.py | |
parent | 4de39f91d9d8942816b8967a115010c466b8f252 (diff) | |
download | wee-slack-b3a378462ba3f7851c4e4d8f63c781f8d498290d.tar.gz |
Use Optional instead of Union with None
Diffstat (limited to 'slack/config.py')
-rw-r--r-- | slack/config.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/slack/config.py b/slack/config.py index ae31350..8b60ac1 100644 --- a/slack/config.py +++ b/slack/config.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Union +from typing import Optional import weechat @@ -88,8 +88,8 @@ class SlackConfigSectionWorkspace: def __init__( self, section: WeeChatSection, - workspace_name: Union[str, None], - parent_config: Union[SlackConfigSectionWorkspace, None], + workspace_name: Optional[str], + parent_config: Optional[SlackConfigSectionWorkspace], ): self._section = section self._workspace_name = workspace_name @@ -132,9 +132,9 @@ class SlackConfigSectionWorkspace: name: str, description: str, default_value: WeeChatOptionType, - min_value: Union[int, None] = None, - max_value: Union[int, None] = None, - string_values: Union[str, None] = None, + min_value: Optional[int] = None, + max_value: Optional[int] = None, + string_values: Optional[str] = None, ) -> WeeChatOption[WeeChatOptionType]: if self._workspace_name: option_name = f"{self._workspace_name}.{name}" @@ -159,7 +159,7 @@ class SlackConfigSectionWorkspace: def config_section_workspace_read_cb( - data: str, config_file: str, section: str, option_name: str, value: Union[str, None] + data: str, config_file: str, section: str, option_name: str, value: Optional[str] ) -> int: option_split = option_name.split(".", 1) if len(option_split) < 2: |