@@ -79,21 +79,21 @@ class Future(abc.ABC, Generic[_TFutureValue]):
79
79
@abc .abstractmethod
80
80
def done (self ) -> bool : ...
81
81
@abc .abstractmethod
82
- def exception (self , timeout : float | None = ... ) -> Exception | None : ...
82
+ def exception (self , timeout : float | None = None ) -> Exception | None : ...
83
83
@abc .abstractmethod
84
- def result (self , timeout : float | None = ... ) -> _TFutureValue : ...
84
+ def result (self , timeout : float | None = None ) -> _TFutureValue : ...
85
85
@abc .abstractmethod
86
86
def running (self ) -> bool : ...
87
87
88
88
# FIXME: unsure of the exact return type here. Is it a traceback.StackSummary?
89
89
@abc .abstractmethod
90
- def traceback (self , timeout : float | None = ...) -> Any : ...
90
+ def traceback (self , timeout : float | None = None ) : ...
91
91
92
92
# Create Client:
93
93
94
- def insecure_channel (target : str , options : _Options | None = ... , compression : Compression | None = ... ) -> Channel : ...
94
+ def insecure_channel (target : str , options : _Options | None = None , compression : Compression | None = None ) -> Channel : ...
95
95
def secure_channel (
96
- target : str , credentials : ChannelCredentials , options : _Options | None = ... , compression : Compression | None = ...
96
+ target : str , credentials : ChannelCredentials , options : _Options | None = None , compression : Compression | None = None
97
97
) -> Channel : ...
98
98
99
99
_Interceptor : TypeAlias = (
@@ -108,14 +108,14 @@ def intercept_channel(channel: Channel, *interceptors: _Interceptor[_TRequest, _
108
108
# Create Client Credentials:
109
109
110
110
def ssl_channel_credentials (
111
- root_certificates : bytes | None = ... , private_key : bytes | None = ... , certificate_chain : bytes | None = ...
111
+ root_certificates : bytes | None = None , private_key : bytes | None = None , certificate_chain : bytes | None = None
112
112
) -> ChannelCredentials : ...
113
113
def local_channel_credentials (local_connect_type : LocalConnectionType = ...) -> ChannelCredentials : ...
114
- def metadata_call_credentials (metadata_plugin : AuthMetadataPlugin , name : str | None = ... ) -> CallCredentials : ...
114
+ def metadata_call_credentials (metadata_plugin : AuthMetadataPlugin , name : str | None = None ) -> CallCredentials : ...
115
115
def access_token_call_credentials (access_token : str ) -> CallCredentials : ...
116
- def alts_channel_credentials (service_accounts : Sequence [str ] | None = ... ) -> ChannelCredentials : ...
116
+ def alts_channel_credentials (service_accounts : Sequence [str ] | None = None ) -> ChannelCredentials : ...
117
117
def compute_engine_channel_credentials (call_credentials : CallCredentials ) -> ChannelCredentials : ...
118
- def xds_channel_credentials (fallback_credentials : ChannelCredentials | None = ... ) -> ChannelCredentials : ...
118
+ def xds_channel_credentials (fallback_credentials : ChannelCredentials | None = None ) -> ChannelCredentials : ...
119
119
120
120
# GRPC docs say there should be at least two:
121
121
def composite_call_credentials (creds1 : CallCredentials , creds2 : CallCredentials , * rest : CallCredentials ) -> CallCredentials : ...
@@ -129,12 +129,12 @@ def composite_channel_credentials(
129
129
130
130
def server (
131
131
thread_pool : futures .ThreadPoolExecutor ,
132
- handlers : list [GenericRpcHandler [Any , Any ]] | None = ... ,
133
- interceptors : list [ServerInterceptor [Any , Any ]] | None = ... ,
134
- options : _Options | None = ... ,
135
- maximum_concurrent_rpcs : int | None = ... ,
136
- compression : Compression | None = ... ,
137
- xds : bool = ... ,
132
+ handlers : list [GenericRpcHandler [Any , Any ]] | None = None ,
133
+ interceptors : list [ServerInterceptor [Any , Any ]] | None = None ,
134
+ options : _Options | None = None ,
135
+ maximum_concurrent_rpcs : int | None = None ,
136
+ compression : Compression | None = None ,
137
+ xds : bool = False ,
138
138
) -> Server : ...
139
139
140
140
# Create Server Credentials:
@@ -143,17 +143,17 @@ _CertificateChainPair: TypeAlias = tuple[bytes, bytes]
143
143
144
144
def ssl_server_credentials (
145
145
private_key_certificate_chain_pairs : list [_CertificateChainPair ],
146
- root_certificates : bytes | None = ... ,
147
- require_client_auth : bool = ... ,
146
+ root_certificates : bytes | None = None ,
147
+ require_client_auth : bool = False ,
148
148
) -> ServerCredentials : ...
149
149
def local_server_credentials (local_connect_type : LocalConnectionType = ...) -> ServerCredentials : ...
150
150
def ssl_server_certificate_configuration (
151
- private_key_certificate_chain_pairs : list [_CertificateChainPair ], root_certificates : bytes | None = ...
151
+ private_key_certificate_chain_pairs : list [_CertificateChainPair ], root_certificates : bytes | None = None
152
152
) -> ServerCertificateConfiguration : ...
153
153
def dynamic_ssl_server_credentials (
154
154
initial_certificate_configuration : ServerCertificateConfiguration ,
155
155
certificate_configuration_fetcher : Callable [[], ServerCertificateConfiguration ],
156
- require_client_authentication : bool = ... ,
156
+ require_client_authentication : bool = False ,
157
157
) -> ServerCredentials : ...
158
158
def alts_server_credentials () -> ServerCredentials : ...
159
159
def insecure_server_credentials () -> ServerCredentials : ...
@@ -174,23 +174,23 @@ class _Behaviour(Protocol):
174
174
175
175
def unary_unary_rpc_method_handler (
176
176
behavior : _Behaviour ,
177
- request_deserializer : _RequestDeserializer | None = ... ,
178
- response_serializer : _ResponseSerializer | None = ... ,
177
+ request_deserializer : _RequestDeserializer | None = None ,
178
+ response_serializer : _ResponseSerializer | None = None ,
179
179
) -> RpcMethodHandler [Any , Any ]: ...
180
180
def unary_stream_rpc_method_handler (
181
181
behavior : _Behaviour ,
182
- request_deserializer : _RequestDeserializer | None = ... ,
183
- response_serializer : _ResponseSerializer | None = ... ,
182
+ request_deserializer : _RequestDeserializer | None = None ,
183
+ response_serializer : _ResponseSerializer | None = None ,
184
184
) -> RpcMethodHandler [Any , Any ]: ...
185
185
def stream_unary_rpc_method_handler (
186
186
behavior : _Behaviour ,
187
- request_deserializer : _RequestDeserializer | None = ... ,
188
- response_serializer : _ResponseSerializer | None = ... ,
187
+ request_deserializer : _RequestDeserializer | None = None ,
188
+ response_serializer : _ResponseSerializer | None = None ,
189
189
) -> RpcMethodHandler [Any , Any ]: ...
190
190
def stream_stream_rpc_method_handler (
191
191
behavior : _Behaviour ,
192
- request_deserializer : _RequestDeserializer | None = ... ,
193
- response_serializer : _ResponseSerializer | None = ... ,
192
+ request_deserializer : _RequestDeserializer | None = None ,
193
+ response_serializer : _ResponseSerializer | None = None ,
194
194
) -> RpcMethodHandler [Any , Any ]: ...
195
195
def method_handlers_generic_handler (
196
196
service : str , method_handlers : dict [str , RpcMethodHandler [Any , Any ]]
@@ -248,31 +248,31 @@ class Channel(abc.ABC):
248
248
def stream_stream (
249
249
self ,
250
250
method : str ,
251
- request_serializer : _RequestSerializer | None = ... ,
252
- response_deserializer : _ResponseDeserializer | None = ... ,
251
+ request_serializer : _RequestSerializer | None = None ,
252
+ response_deserializer : _ResponseDeserializer | None = None ,
253
253
) -> StreamStreamMultiCallable [Any , Any ]: ...
254
254
@abc .abstractmethod
255
255
def stream_unary (
256
256
self ,
257
257
method : str ,
258
- request_serializer : _RequestSerializer | None = ... ,
259
- response_deserializer : _ResponseDeserializer | None = ... ,
258
+ request_serializer : _RequestSerializer | None = None ,
259
+ response_deserializer : _ResponseDeserializer | None = None ,
260
260
) -> StreamUnaryMultiCallable [Any , Any ]: ...
261
261
@abc .abstractmethod
262
- def subscribe (self , callback : Callable [[ChannelConnectivity ], None ], try_to_connect : bool = ... ) -> None : ...
262
+ def subscribe (self , callback : Callable [[ChannelConnectivity ], None ], try_to_connect : bool = False ) -> None : ...
263
263
@abc .abstractmethod
264
264
def unary_stream (
265
265
self ,
266
266
method : str ,
267
- request_serializer : _RequestSerializer | None = ... ,
268
- response_deserializer : _ResponseDeserializer | None = ... ,
267
+ request_serializer : _RequestSerializer | None = None ,
268
+ response_deserializer : _ResponseDeserializer | None = None ,
269
269
) -> UnaryStreamMultiCallable [Any , Any ]: ...
270
270
@abc .abstractmethod
271
271
def unary_unary (
272
272
self ,
273
273
method : str ,
274
- request_serializer : _RequestSerializer | None = ... ,
275
- response_deserializer : _ResponseDeserializer | None = ... ,
274
+ request_serializer : _RequestSerializer | None = None ,
275
+ response_deserializer : _ResponseDeserializer | None = None ,
276
276
) -> UnaryUnaryMultiCallable [Any , Any ]: ...
277
277
@abc .abstractmethod
278
278
def unsubscribe (self , callback : Callable [[ChannelConnectivity ], None ]) -> None : ...
@@ -303,7 +303,7 @@ class Server(abc.ABC):
303
303
304
304
# Block current thread until the server stops. Returns a bool
305
305
# indicates if the operation times out. Timeout is in seconds.
306
- def wait_for_termination (self , timeout : float | None = ... ) -> bool : ...
306
+ def wait_for_termination (self , timeout : float | None = None ) -> bool : ...
307
307
308
308
# Authentication & Authorization Objects:
309
309
@@ -538,34 +538,31 @@ class UnaryUnaryMultiCallable(abc.ABC, Generic[_TRequest, _TResponse]):
538
538
def __call__ (
539
539
self ,
540
540
request : _TRequest ,
541
- timeout : float | None = ...,
542
- metadata : _Metadata | None = ...,
543
- credentials : CallCredentials | None = ...,
544
- # FIXME: optional bool seems weird, but that's what the docs suggest
545
- wait_for_ready : bool | None = ...,
546
- compression : Compression | None = ...,
541
+ timeout : float | None = None ,
542
+ metadata : _Metadata | None = None ,
543
+ credentials : CallCredentials | None = None ,
544
+ wait_for_ready : bool | None = None ,
545
+ compression : Compression | None = None ,
547
546
) -> _TResponse : ...
548
547
@abc .abstractmethod
549
548
def future (
550
549
self ,
551
550
request : _TRequest ,
552
- timeout : float | None = ...,
553
- metadata : _Metadata | None = ...,
554
- credentials : CallCredentials | None = ...,
555
- # FIXME: optional bool seems weird, but that's what the docs suggest
556
- wait_for_ready : bool | None = ...,
557
- compression : Compression | None = ...,
551
+ timeout : float | None = None ,
552
+ metadata : _Metadata | None = None ,
553
+ credentials : CallCredentials | None = None ,
554
+ wait_for_ready : bool | None = None ,
555
+ compression : Compression | None = None ,
558
556
) -> _CallFuture [_TResponse ]: ...
559
557
@abc .abstractmethod
560
558
def with_call (
561
559
self ,
562
560
request : _TRequest ,
563
- timeout : float | None = ...,
564
- metadata : _Metadata | None = ...,
565
- credentials : CallCredentials | None = ...,
566
- # FIXME: optional bool seems weird, but that's what the docs suggest
567
- wait_for_ready : bool | None = ...,
568
- compression : Compression | None = ...,
561
+ timeout : float | None = None ,
562
+ metadata : _Metadata | None = None ,
563
+ credentials : CallCredentials | None = None ,
564
+ wait_for_ready : bool | None = None ,
565
+ compression : Compression | None = None ,
569
566
# FIXME: Return value is documented as "The response value for the RPC and a Call value for the RPC";
570
567
# this is slightly unclear so this return type is a best-effort guess.
571
568
) -> tuple [_TResponse , Call ]: ...
@@ -575,47 +572,43 @@ class UnaryStreamMultiCallable(abc.ABC, Generic[_TRequest, _TResponse]):
575
572
def __call__ (
576
573
self ,
577
574
request : _TRequest ,
578
- timeout : float | None = ...,
579
- metadata : _Metadata | None = ...,
580
- credentials : CallCredentials | None = ...,
581
- # FIXME: optional bool seems weird, but that's what the docs suggest
582
- wait_for_ready : bool | None = ...,
583
- compression : Compression | None = ...,
575
+ timeout : float | None = None ,
576
+ metadata : _Metadata | None = None ,
577
+ credentials : CallCredentials | None = None ,
578
+ wait_for_ready : bool | None = None ,
579
+ compression : Compression | None = None ,
584
580
) -> _CallIterator [_TResponse ]: ...
585
581
586
582
class StreamUnaryMultiCallable (abc .ABC , Generic [_TRequest , _TResponse ]):
587
583
@abc .abstractmethod
588
584
def __call__ (
589
585
self ,
590
586
request_iterator : Iterator [_TRequest ],
591
- timeout : float | None = ...,
592
- metadata : _Metadata | None = ...,
593
- credentials : CallCredentials | None = ...,
594
- # FIXME: optional bool seems weird, but that's what the docs suggest
595
- wait_for_ready : bool | None = ...,
596
- compression : Compression | None = ...,
587
+ timeout : float | None = None ,
588
+ metadata : _Metadata | None = None ,
589
+ credentials : CallCredentials | None = None ,
590
+ wait_for_ready : bool | None = None ,
591
+ compression : Compression | None = None ,
597
592
) -> _TResponse : ...
598
593
@abc .abstractmethod
599
594
def future (
600
595
self ,
601
596
request_iterator : Iterator [_TRequest ],
602
- timeout : float | None = ...,
603
- metadata : _Metadata | None = ...,
604
- credentials : CallCredentials | None = ...,
605
- # FIXME: optional bool seems weird, but that's what the docs suggest
606
- wait_for_ready : bool | None = ...,
607
- compression : Compression | None = ...,
597
+ timeout : float | None = None ,
598
+ metadata : _Metadata | None = None ,
599
+ credentials : CallCredentials | None = None ,
600
+ wait_for_ready : bool | None = None ,
601
+ compression : Compression | None = None ,
608
602
) -> _CallFuture [_TResponse ]: ...
609
603
@abc .abstractmethod
610
604
def with_call (
611
605
self ,
612
606
request_iterator : Iterator [_TRequest ],
613
- timeout : float | None = ...,
614
- metadata : _Metadata | None = ...,
615
- credentials : CallCredentials | None = ...,
616
- # FIXME: optional bool seems weird, but that's what the docs suggest
617
- wait_for_ready : bool | None = ...,
618
- compression : Compression | None = ...,
607
+ timeout : float | None = None ,
608
+ metadata : _Metadata | None = None ,
609
+ credentials : CallCredentials | None = None ,
610
+ wait_for_ready : bool | None = None ,
611
+ compression : Compression | None = None ,
619
612
# FIXME: Return value is documented as "The response value for the RPC and a Call value for the RPC";
620
613
# this is slightly unclear so this return type is a best-effort guess.
621
614
) -> tuple [_TResponse , Call ]: ...
@@ -625,12 +618,11 @@ class StreamStreamMultiCallable(abc.ABC, Generic[_TRequest, _TResponse]):
625
618
def __call__ (
626
619
self ,
627
620
request_iterator : Iterator [_TRequest ],
628
- timeout : float | None = ...,
629
- metadata : _Metadata | None = ...,
630
- credentials : CallCredentials | None = ...,
631
- # FIXME: optional bool seems weird, but that's what the docs suggest
632
- wait_for_ready : bool | None = ...,
633
- compression : Compression | None = ...,
621
+ timeout : float | None = None ,
622
+ metadata : _Metadata | None = None ,
623
+ credentials : CallCredentials | None = None ,
624
+ wait_for_ready : bool | None = None ,
625
+ compression : Compression | None = None ,
634
626
) -> _CallIterator [_TResponse ]: ...
635
627
636
628
# Runtime Protobuf Parsing:
0 commit comments