Summary
Deduplicate httpx timeout construction in vws/transports.py where HTTPXTransport.__call__ and AsyncHTTPXTransport.__call__ each use the same isinstance(request_timeout, tuple) branch.
Precise locations
- File:
src/vws/transports.py
HTTPXTransport.__call__: lines 152–166 (approx.)
AsyncHTTPXTransport.__call__: lines 275–289 (approx.)
Suggested approach
- Add a private helper, e.g.
_httpx_timeout(request_timeout: float | tuple[float, float]) -> httpx.Timeout, implemented with match request_timeout::
case (connect, read): → per-field timeouts
case float() | int() as t: → symmetric connect/read (today only float in the annotation, but runtime may pass int from callers — preserve current coercion behavior)
- Call the helper from both transport classes.
Summary
Deduplicate httpx timeout construction in
vws/transports.pywhereHTTPXTransport.__call__andAsyncHTTPXTransport.__call__each use the sameisinstance(request_timeout, tuple)branch.Precise locations
src/vws/transports.pyHTTPXTransport.__call__: lines 152–166 (approx.)AsyncHTTPXTransport.__call__: lines 275–289 (approx.)Suggested approach
_httpx_timeout(request_timeout: float | tuple[float, float]) -> httpx.Timeout, implemented withmatch request_timeout::case (connect, read):→ per-field timeoutscase float() | int() as t:→ symmetric connect/read (today onlyfloatin the annotation, but runtime may pass int from callers — preserve current coercion behavior)