File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 18
18
pagination, and long-running operations to gRPC methods.
19
19
"""
20
20
21
+ import enum
21
22
import functools
22
23
23
24
from google .api_core import grpc_helpers
24
25
from google .api_core import timeout
25
26
from google .api_core .gapic_v1 import client_info
26
27
27
28
USE_DEFAULT_METADATA = object ()
28
- DEFAULT = object ()
29
+
30
+
31
+ class _MethodDefault (enum .Enum ):
32
+ # Uses enum so that pytype/mypy knows that this is the only possible value.
33
+ # https://stackoverflow.com/a/60605919/101923
34
+ #
35
+ # Literal[_DEFAULT_VALUE] is an alternative, but only added in Python 3.8.
36
+ # https://docs.python.org/3/library/typing.html#typing.Literal
37
+ _DEFAULT_VALUE = object ()
38
+
39
+
40
+ DEFAULT = _MethodDefault ._DEFAULT_VALUE
29
41
"""Sentinel value indicating that a retry or timeout argument was unspecified,
30
42
so the default should be used."""
31
43
You can’t perform that action at this time.
0 commit comments