Skip to content

Conversation

@florimondmanca
Copy link
Contributor

Fixes an issue with our TimeoutTypes that makes mypy complain if users pass None's as part of a timeout tuple (although None are accepted, meaning "no timeout"):

# example.py
import httpx

_ = httpx.Timeout((1.0, None, None, None))
$ mypy example.py
example.py:3: error: Argument 1 to "Timeout" has incompatible type "Tuple[float, None, None, None]"; expected "Union[float, Tuple[float, float, float, float], Timeout, None]"
Found 1 error in 1 file (checked 1 source file)

Copy link
Contributor

@yeraydiazdiaz yeraydiazdiaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@florimondmanca florimondmanca merged commit c143503 into master May 25, 2020
@florimondmanca florimondmanca deleted the timeout-types branch May 25, 2020 05:56
@lovelydinosaur lovelydinosaur mentioned this pull request May 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants