File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1818pagination, and long-running operations to gRPC methods.
1919"""
2020
21+ import enum
2122import functools
2223
2324from google .api_core import grpc_helpers
2425from google .api_core import timeout
2526from google .api_core .gapic_v1 import client_info
2627
2728USE_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
2941"""Sentinel value indicating that a retry or timeout argument was unspecified,
3042so the default should be used."""
3143
You can’t perform that action at this time.
0 commit comments