MCPcopy
hub / github.com/encode/httpx / UseClientDefault

Class UseClientDefault

httpx/_client.py:94–111  ·  view source on GitHub ↗

For some parameters such as `auth=...` and `timeout=...` we need to be able to indicate the default "unset" state, in a way that is distinctly different to using `None`. The default "unset" state indicates that whatever default is set on the client should be used. This is diffe

Source from the content-addressed store, hash-verified

92
93
94class UseClientDefault:
95 """
96 For some parameters such as `auth=...` and `timeout=...` we need to be able
97 to indicate the default "unset" state, in a way that is distinctly different
98 to using `None`.
99
100 The default "unset" state indicates that whatever default is set on the
101 client should be used. This is different to setting `None`, which
102 explicitly disables the parameter, possibly overriding a client default.
103
104 For example we use `timeout=USE_CLIENT_DEFAULT` in the `request()` signature.
105 Omitting the `timeout` parameter will send a request using whatever default
106 timeout has been configured on the client. Including `timeout=None` will
107 ensure no timeout is used.
108
109 Note that user code shouldn't need to use the `USE_CLIENT_DEFAULT` constant,
110 but it is used internally when a parameter is not included.
111 """
112
113
114USE_CLIENT_DEFAULT = UseClientDefault()

Callers 1

_client.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected