Skip to content

Commit 01ab3f4

Browse files
authored
Fix async prefix for groupby type annotation overloads. (#64)
The overload functions are not generator functions, so mypy currently infers that they return an awaitable that yields an AsyncIterator rather than that they return an AsyncIterator directly.
1 parent 3ea2a47 commit 01ab3f4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

asyncstdlib/itertools.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -512,21 +512,21 @@ async def identity(x: T) -> T:
512512

513513

514514
@overload # noqa: F811
515-
async def groupby( # noqa: F811
515+
def groupby( # noqa: F811
516516
iterable: AnyIterable[T],
517517
) -> AsyncIterator[Tuple[T, AsyncIterator[T]]]:
518518
...
519519

520520

521521
@overload # noqa: F811
522-
async def groupby( # noqa: F811
522+
def groupby( # noqa: F811
523523
iterable: AnyIterable[T], key: None
524524
) -> AsyncIterator[Tuple[T, AsyncIterator[T]]]:
525525
...
526526

527527

528528
@overload # noqa: F811
529-
async def groupby( # noqa: F811
529+
def groupby( # noqa: F811
530530
iterable: AnyIterable[T], key: Union[Callable[[T], R], Callable[[T], Awaitable[R]]]
531531
) -> AsyncIterator[Tuple[R, AsyncIterator[T]]]:
532532
...

0 commit comments

Comments
 (0)