Skip to content

Commit f3511ab

Browse files
committed
update mypy and bugbear
1 parent 8454210 commit f3511ab

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

requirements-dev.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ coverage==7.*
1212
# typechecking
1313
# pyre-check==0.9.*
1414
# pyright==1.*
15-
mypy==1.13.*
15+
mypy==1.14.*
1616
typing-extensions==4.*
1717
pytype==2024.10.11
1818

@@ -21,7 +21,7 @@ bandit[toml]==1.*
2121
pylint==3.3.*
2222
flake8==7.1.*
2323
flake8-builtins==2.5.*
24-
flake8-bugbear==24.10.31
24+
flake8-bugbear==24.12.12
2525
flake8-comprehensions==3.*
2626
flake8-docstrings==1.*
2727
flake8-no-pep420==2.*

typed_stream/_impl/stream.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,15 @@ def __getitem__(self, item: int, /) -> T:
9292
"""Nobody inspects the spammish repetition."""
9393

9494
@typing.overload
95-
def __getitem__(self, item: slice, /) -> streamable.StreamableSequence[T]:
95+
def __getitem__(
96+
self, item: slice[int | None, int | None, int | None], / # noqa: W504
97+
) -> streamable.StreamableSequence[T]:
9698
"""Nobody inspects the spammish repetition."""
9799

98100
def __getitem__(
99-
self, item: slice | int, / # noqa: W504
101+
self,
102+
item: slice[int | None, int | None, int | None] | int,
103+
/, # noqa: W504
100104
) -> streamable.StreamableSequence[T] | T:
101105
"""Finish the stream by collecting.
102106
@@ -396,7 +400,8 @@ def chunk(self, size: int) -> Stream[tuple[T, ...]]:
396400
"""
397401
return self._finish(
398402
Stream(
399-
itertools.batched(self._data, size),
403+
# add strict=False if min version is 3.13 (is the default)
404+
itertools.batched(self._data, size), # noqa: B911
400405
)
401406
)
402407

typed_stream/streamable.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,16 @@ def __getitem__(self, item: SupportsIndex, /) -> T:
7979
"""Nobody inspects the spammish repetition."""
8080

8181
@overload
82-
def __getitem__(self, item: slice, /) -> StreamableSequence[T]:
82+
def __getitem__(
83+
self, item: slice[int | None, int | None, int | None], / # noqa: W504
84+
) -> StreamableSequence[T]:
8385
"""Nobody inspects the spammish repetition."""
8486

8587
@override
8688
def __getitem__(
87-
self, item: slice | SupportsIndex, / # noqa: W504
89+
self,
90+
item: slice[int | None, int | None, int | None] | SupportsIndex,
91+
/, # noqa: W504
8892
) -> StreamableSequence[T] | T:
8993
"""Finish the stream by collecting."""
9094
if isinstance(item, slice):

0 commit comments

Comments
 (0)