-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Describe the feature / enhancement and how it would improve things
Currently, changing the values in tls_requests.settings has no effect because the default argument values are set only once at the time the function is defined.
Enabling this feature allows users to modify the default configuration without explicitly specifying the reverent arguments in every function call.
If you agree on this suggestion, I can implement this and create a PR later.
Describe how your proposal will work, with code and/or pseudo-code
The default settings should be evaluated at the time when the function is called. For example, in tls_requests.api.request:
def request(
...,
timeout: TimeoutTypes = None,
) -> Response:
if timeout is None:
timeout = DEFAULT_TIMEOUT
...Then, running tls_requests.settings.DEFAULT_TIMEOUT = 60.0 would take effect.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request