From e203c2ba38d1c8338e5b9b589e1b53c8a01adb1d Mon Sep 17 00:00:00 2001 From: Micah Denbraver Date: Mon, 5 May 2025 06:45:25 -0700 Subject: [PATCH] grpc `_CallIterator` is an iterator (#13925) --- stubs/grpcio/@tests/test_cases/check_grpc.py | 1 + stubs/grpcio/grpc/__init__.pyi | 1 + 2 files changed, 2 insertions(+) diff --git a/stubs/grpcio/@tests/test_cases/check_grpc.py b/stubs/grpcio/@tests/test_cases/check_grpc.py index e413ba974..4ff365685 100644 --- a/stubs/grpcio/@tests/test_cases/check_grpc.py +++ b/stubs/grpcio/@tests/test_cases/check_grpc.py @@ -44,3 +44,4 @@ assert_type(call_details.timeout, Optional[float]) call_iter = cast(grpc._CallIterator[str], None) for call in call_iter: assert_type(call, str) +assert_type(next(call_iter), str) diff --git a/stubs/grpcio/grpc/__init__.pyi b/stubs/grpcio/grpc/__init__.pyi index caf5e9884..47de021b0 100644 --- a/stubs/grpcio/grpc/__init__.pyi +++ b/stubs/grpcio/grpc/__init__.pyi @@ -426,6 +426,7 @@ class UnaryUnaryClientInterceptor(abc.ABC, Generic[_TRequest, _TResponse]): @type_check_only class _CallIterator(Call, Generic[_TResponse], metaclass=abc.ABCMeta): def __iter__(self) -> Iterator[_TResponse]: ... + def __next__(self) -> _TResponse: ... class UnaryStreamClientInterceptor(abc.ABC, Generic[_TRequest, _TResponse]): @abc.abstractmethod