From f5c3673f2c690c9edc96a95ecfef9970818b07ee Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Fri, 11 Aug 2023 04:18:01 -0600 Subject: [PATCH] Config(): Fix bool comparison to match types (mypy --strict) MyPy warning was: src/waybar_check_gmail/config/config.py:73:20:73:46: error: Non-overlapping identity check (left operand type: "Union[str, bool, None]", right operand type: "Type[bool]") [comparison-overlap] if self._map[sec][key] is bool: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ Found 1 error in 1 file (checked 1 source file) --- src/waybar_check_gmail/config/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/waybar_check_gmail/config/config.py b/src/waybar_check_gmail/config/config.py index ede2c24..e1f30e5 100644 --- a/src/waybar_check_gmail/config/config.py +++ b/src/waybar_check_gmail/config/config.py @@ -70,7 +70,7 @@ def __init__(self, fn: AnyPath): for key, val in config.items(sec): if key not in self._map[sec]: die("Unexpected config key in section {}: {}".format(sec, key)) - if self._map[sec][key] is bool: + if isinstance(self._map[sec][key], bool): self._map[sec][key] = config.getboolean(sec, key) else: self._map[sec][key] = val