Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/thread/utils/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Callable, Literal, Union
from typing import Any, Callable, Literal, Union, cast

_Verbosity_Num = Literal[0, 1, 2]
_Verbosity_Enum = Literal['quiet', 'normal', 'verbose']
Expand Down Expand Up @@ -79,6 +79,7 @@ def _compare(
return operator(self.level_number, other)
if isinstance(other, str):
if Verbosity.is_valid_level(other):
other = cast(_Verbosity_Enum, other)
return operator(self.level_number, VerbosityMapping[other])
return operator(self.level_string, other)
raise ValueError('Cannot compare Verbosity with other types')
Expand Down