From de965c2bf51355068599453e52833e37625d1fd5 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 6 May 2021 08:23:18 -0400 Subject: [PATCH] Simplify SnowflakeList type hints --- discord/utils.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/discord/utils.py b/discord/utils.py index 4a6922b6a..32d8feb4a 100644 --- a/discord/utils.py +++ b/discord/utils.py @@ -564,18 +564,10 @@ class SnowflakeList(array.array): if TYPE_CHECKING: - @overload - def __init__(self, data: Iterable[int], *, is_sorted: Literal[False] = False): + def __init__(self, data: Iterable[int], *, is_sorted: bool = False): ... - @overload - def __init__(self, data: Sequence[int], *, is_sorted: Literal[True]): - ... - - def __init__(self, data: Union[Sequence[int], Iterable[int]], *, is_sorted: bool = False): - ... - - def __new__(cls, data: Union[Sequence[int], Iterable[int]], *, is_sorted: bool = False): + def __new__(cls, data: Iterable[int], *, is_sorted: bool = False): return array.array.__new__(cls, 'Q', data if is_sorted else sorted(data)) # type: ignore def add(self, element: int) -> None: