Use less private imports on the testclient module#2709
Use less private imports on the testclient module#2709
Conversation
| Auth: TypeAlias = "httpx.Auth | tuple[str | bytes, str | bytes]" | ||
| QueryParams: TypeAlias = "httpx.QueryParams | typing.Mapping[str, str] | None" | ||
| Cookies: TypeAlias = "httpx.Cookies | CookieJar | dict[str, str] | list[tuple[str, str]] | None" | ||
| URL: TypeAlias = "httpx.URL | str" | ||
| Timeout: TypeAlias = "float | httpx.Timeout | tuple[float | None, float | None, float | None, float | None] | None" | ||
| Headers = typing.Union[ | ||
| httpx.Headers, | ||
| typing.Mapping[bytes, bytes], | ||
| typing.Mapping[str, str], | ||
| typing.Sequence[typing.Tuple[bytes, bytes]], | ||
| typing.Sequence[typing.Tuple[str, str]], | ||
| None, | ||
| ] |
There was a problem hiding this comment.
I pretty much have to do what httpx is doing on the _client module because I think we want to support the type possibilities that are there...
|
@tomchristie Can we discuss/have a plan with this before httpx 1.0? |
|
@zanieb @tomchristie was this discussed in the meeting? |
|
To an extent... we did talk about stricter typing. I'll see about spinning out a design discussion. |
|
What is expected from Starlette? |
|
| params: QueryParams | None = None, | ||
| headers: Headers | None = None, | ||
| cookies: Cookies | None = None, | ||
| auth: Auth | httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT, |
There was a problem hiding this comment.
Possibly...
UseClientDefault = type(httpx.USE_CLIENT_DEFAULT)
...
auth: Auth | UseClientDefault = USE_CLIENT_DEFAULT(I don't much like this style and I'd enjoy cleaning it up, tho would that be sufficient for now?)
There was a problem hiding this comment.
I don't think it works for the type checkers.. Does it?
|
I can't really subclass |
httpx. #2673