Skip to content

Commit

Permalink
update mypy
Browse files Browse the repository at this point in the history
SEE: python/mypy#18278
The added Any doesn't change the behaviour of mypy, it was Any before as well.
  • Loading branch information
Joshix-1 committed Feb 12, 2025
1 parent 8c52d26 commit eff53f4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ coverage==7.*
# typechecking
# pyre-check==0.9.*
# pyright==1.*
mypy==1.14.*
mypy==1.15.*
typing-extensions==4.*
pytype==2024.10.11

Expand Down
8 changes: 6 additions & 2 deletions typed_stream/_impl/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
Generic,
Literal,
NoReturn,
ParamSpec,
TypeGuard,
TypeVar,
final,
Expand Down Expand Up @@ -117,8 +118,11 @@ def __call__(self, value: object | None) -> bool:
return value is not None


def count_required_positional_arguments( # type: ignore[misc]
fun: Callable[..., object], / # noqa: W504
_P = ParamSpec("_P")


def count_required_positional_arguments(
fun: Callable[_P, object], / # noqa: W504
) -> int:
"""Count the required positional arguments."""
return len(
Expand Down
7 changes: 5 additions & 2 deletions typed_stream/_impl/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from __future__ import annotations

import operator
import typing
from collections.abc import Callable, Sequence
from numbers import Number, Real
from typing import Concatenate, Generic, Literal, ParamSpec, TypeVar
Expand Down Expand Up @@ -129,8 +130,10 @@ class method_partial(Generic[TArg, TRet, PApplied]): # noqa: N801,D301
"""

_fun: Callable[Concatenate[TArg, PApplied], TRet]
_args: PApplied.args
_kwargs: PApplied.kwargs
# PApplied.args
_args: typing.Any # type: ignore[explicit-any]
# PApplied.kwargs
_kwargs: typing.Any # type: ignore[explicit-any]

__slots__ = ("_fun", "_args", "_kwargs")

Expand Down

0 comments on commit eff53f4

Please sign in to comment.