mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 03:41:58 +00:00
ruff: Fix UP038 Use X | Y in isinstance call instead of (X, Y).
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
0fa5e7f629
commit
1464009fae
@@ -624,7 +624,7 @@ def check_string_or_int_list(var_name: str, val: object) -> str | list[int]:
|
||||
|
||||
|
||||
def check_string_or_int(var_name: str, val: object) -> str | int:
|
||||
if isinstance(val, (str, int)):
|
||||
if isinstance(val, str | int):
|
||||
return val
|
||||
|
||||
raise ValidationError(_("{var_name} is not a string or integer").format(var_name=var_name))
|
||||
@@ -654,7 +654,7 @@ class WildValue:
|
||||
return self.value == other
|
||||
|
||||
def __len__(self) -> int:
|
||||
if not isinstance(self.value, (dict, list, str)):
|
||||
if not isinstance(self.value, dict | list | str):
|
||||
raise ValidationError(
|
||||
_("{var_name} does not have a length").format(var_name=self.var_name)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user