@@ -15,7 +15,7 @@ from collections.abc import (
1515)
1616from concurrent import futures
1717from types import TracebackType
18- from typing import Any , Generic , NoReturn , TypeAlias , TypeVar , overload , type_check_only
18+ from typing import Any , Final , Generic , Literal , NoReturn , TypeAlias , TypeVar , overload , type_check_only
1919from typing_extensions import Self
2020
2121from grpc import (
@@ -32,9 +32,55 @@ from grpc import (
3232 _Options ,
3333)
3434
35+ __all__ = (
36+ "EOF" ,
37+ "AbortError" ,
38+ "AioRpcError" ,
39+ "BaseError" ,
40+ "Call" ,
41+ "Channel" ,
42+ "ClientCallDetails" ,
43+ "ClientInterceptor" ,
44+ "InterceptedUnaryUnaryCall" ,
45+ "InternalError" ,
46+ "Metadata" ,
47+ "RpcContext" ,
48+ "Server" ,
49+ "ServerInterceptor" ,
50+ "ServicerContext" ,
51+ "StreamStreamCall" ,
52+ "StreamStreamClientInterceptor" ,
53+ "StreamStreamMultiCallable" ,
54+ "StreamUnaryCall" ,
55+ "StreamUnaryClientInterceptor" ,
56+ "StreamUnaryMultiCallable" ,
57+ "UnaryStreamCall" ,
58+ "UnaryStreamClientInterceptor" ,
59+ "UnaryStreamMultiCallable" ,
60+ "UnaryUnaryCall" ,
61+ "UnaryUnaryClientInterceptor" ,
62+ "UnaryUnaryMultiCallable" ,
63+ "UsageError" ,
64+ "init_grpc_aio" ,
65+ "insecure_channel" ,
66+ "secure_channel" ,
67+ "server" ,
68+ "shutdown_grpc_aio" ,
69+ )
70+
3571_TRequest = TypeVar ("_TRequest" )
3672_TResponse = TypeVar ("_TResponse" )
3773
74+ @type_check_only
75+ class _EOF :
76+ def __bool__ (self ) -> Literal [False ]: ...
77+ def __len__ (self ) -> Literal [0 ]: ...
78+
79+ EOF : Final [_EOF ]
80+
81+ def init_grpc_aio () -> None : ...
82+ def shutdown_grpc_aio () -> None : ...
83+
3884# Exceptions:
3985
4086class BaseError (Exception ): ...
@@ -46,16 +92,18 @@ class AioRpcError(RpcError):
4692 def __init__ (
4793 self ,
4894 code : StatusCode ,
49- initial_metadata : Metadata ,
50- trailing_metadata : Metadata ,
95+ initial_metadata : Metadata | None = None ,
96+ trailing_metadata : Metadata | None = None ,
5197 details : str | None = None ,
5298 debug_error_string : str | None = None ,
5399 ) -> None : ...
54- def debug_error_string (self ) -> str : ...
100+ def code (self ) -> StatusCode : ...
101+ def details (self ) -> str | None : ...
55102 def initial_metadata (self ) -> Metadata | MaybeNone : ...
56103 # AioRpcError returns the async Metadata, overriding the synchronous
57104 # grpc.RpcError.trailing_metadata() -> tuple[_Metadatum, ...].
58105 def trailing_metadata (self ) -> Metadata | MaybeNone : ... # type: ignore[override]
106+ def debug_error_string (self ) -> str | None : ...
59107
60108# Create Client:
61109
0 commit comments