Open
Description
Bug report
Bug description:
Hi!
Consider the following.
from functools import reduce
from itertools import batched
x = reduce(batched, [1], (1,))
It makes mypy
unhappy!
error: Argument 1 to "reduce" has incompatible type "type[batched[Any]]"; expected "Callable[[tuple[int], int], tuple[int]]" [arg-type]
I did try to previously type hint the tuple with
the_tuple: tuple[int, ...] = (1,)
But the error remains the same.
It may be that I'm not understanding something elementary in which case, thanks for the help! Otherwise, is this a problem of batched
or something deeper?
Thanks!
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Metadata
Metadata
Assignees
Labels
No labels
Activity