-
-
Notifications
You must be signed in to change notification settings - Fork 951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use less private imports on the testclient module #2709
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it works for the type checkers.. Does it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't work.
httpx
. #2673