-
Notifications
You must be signed in to change notification settings - Fork 311
Type annotation of windowed_complete is incorrect #880
Copy link
Copy link
Closed
Description
The docstring of windowed_complete specifies the following:
Yield ``(beginning, middle, end)`` tuples, where: * Each ``middle`` has *n* items from *iterable* * Each ``beginning`` has the items before the ones in ``middle`` * Each ``end`` has the items after the ones in ``middle``
It also provides an example where the iterable is of type Generator[int, None, None] and beginning, middle and end are always tuples of int. However the return type of windowed_complete is specified to be Iterator[tuple[_T, ...]]. According to this, in the example in the docstring the type of beginning, middle and end would be int, which is incorrect.
The correct return type annotation would be Iterator[tuple[tuple[_T, ...], tuple[_T, ...], tuple[_T, ...]]].
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels