Skip to content

Commit 2b34e3d

Browse files
committed
🐛 Fix Luma introduced issues cuz typing
Signed-off-by: Paillat-dev <[email protected]>
1 parent 8bdde08 commit 2b34e3d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

discord/utils/private.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ async def sane_wait_for(futures: Iterable[Awaitable[T]], *, timeout: float) -> s
410410
return done
411411

412412

413-
class SnowflakeList(array.array[int]):
413+
class SnowflakeList(array.array):
414414
"""Internal data storage class to efficiently store a list of snowflakes.
415415
416416
This should have the following characteristics:
@@ -427,6 +427,8 @@ class SnowflakeList(array.array[int]):
427427
if TYPE_CHECKING:
428428

429429
def __init__(self, data: Iterable[int], *, is_sorted: bool = False): ...
430+
def __iter__(self) -> Iterator[int]: ...
431+
def __getitem__(self, i: int) -> int: ...
430432

431433
def __new__(cls, data: Iterable[int], *, is_sorted: bool = False):
432434
return super().__new__(cls, "Q", data if is_sorted else sorted(data))

tests/test_snowflake_datetime.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ def test_generate_snowflake_boundary_high(dt: datetime.datetime, expected_ms: in
6363
assert (sf & ((1 << 22) - 1)) == (2**22 - 1)
6464

6565

66-
@pytest.mark.parametrize(("dt", "expected_ms"), DATETIME_CASES)
66+
@pytest.mark.parametrize(("dt", "_expected_ms"), DATETIME_CASES)
6767
def test_snowflake_time_roundtrip_boundary(dt: datetime.datetime, _expected_ms: int) -> None:
6868
sf_low = generate_snowflake(dt, mode="boundary", high=False)
6969
sf_high = generate_snowflake(dt, mode="boundary", high=True)
7070
assert snowflake_time(sf_low) == dt
7171
assert snowflake_time(sf_high) == dt
7272

7373

74-
@pytest.mark.parametrize(("dt", "expected_ms"), DATETIME_CASES)
74+
@pytest.mark.parametrize(("dt", "_expected_ms"), DATETIME_CASES)
7575
def test_snowflake_time_roundtrip_realistic(dt: datetime.datetime, _expected_ms: int) -> None:
7676
sf = generate_snowflake(dt, mode="realistic")
7777
assert snowflake_time(sf) == dt

0 commit comments

Comments
 (0)