TwilioHttpClient's timeout type hint is incorrect
byarmis opened this issue · comments
Issue Summary
The type hint in twilio-python/http_client.py
's line 25 is incorrect. Currently, it's an int
, but it's passed more-or-less directly to requests.sessions.send
which accepts a float
Steps to Reproduce
- Import
TwilioHttpClient
- Specify timeout with a float
- Type check (with IDE)
- Get error
Code Snippet
http_client = TwilioHttpClient(timeout=3.1)
Exception/Log
Expected type 'int', got 'float' instead
Technical details:
- twilio-python version:
twilio-7.15.4
- python version: 3.10
Mypy does not validate typing in docstrings, but my IDE (PyCharm) at least does
Makes sense will. Take a loot at the PR.
Note that the request interface types this as float
:
twilio-python/twilio/http/http_client.py
Line 55 in 85706b3