From 736c487eade34bcdeccadc71fe541faa05bc8f18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20K=C3=BChn?= Date: Mon, 23 Jun 2025 18:06:50 +0200 Subject: [PATCH 1/2] type checkers can't agree on method arguments... --- asyncstdlib/asynctools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asyncstdlib/asynctools.py b/asyncstdlib/asynctools.py index 04c7620..eddada9 100644 --- a/asyncstdlib/asynctools.py +++ b/asyncstdlib/asynctools.py @@ -35,7 +35,7 @@ class _BorrowedAsyncIterator(AsyncGenerator[T, S]): __slots__ = "__wrapped__", "__anext__", "asend", "athrow", "_wrapper" # Type checker does not understand `__slot__` definitions - __anext__: Callable[[Any], Coroutine[Any, Any, T]] + __anext__: Callable[..., Coroutine[Any, Any, T]] asend: Any athrow: Any From d3e1508555e2afba1226fa0b30c63a2ba925a3e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20K=C3=BChn?= Date: Mon, 23 Jun 2025 18:07:08 +0200 Subject: [PATCH 2/2] remove obsolete downstream ignore --- asyncstdlib/asynctools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asyncstdlib/asynctools.py b/asyncstdlib/asynctools.py index eddada9..556832a 100644 --- a/asyncstdlib/asynctools.py +++ b/asyncstdlib/asynctools.py @@ -49,7 +49,7 @@ def __init__(self, iterator: Union[AsyncIterator[T], AsyncGenerator[T, S]]): # An async *iterator* (e.g. `async def: yield`) must return # itself from __aiter__. If we do not shadow this then # running aiter(self).aclose closes the underlying iterator. - self.__anext__ = self._wrapper.__anext__ # type: ignore + self.__anext__ = self._wrapper.__anext__ if hasattr(iterator, "asend"): self.asend = ( iterator.asend # pyright: ignore[reportUnknownMemberType,reportAttributeAccessIssue]