Skip to content
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

add support for any type of URL as long as it can be stringified #3450

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
TYP: hardcode self._uri_reference s type for mypy
MarcBresson committed Dec 12, 2024
commit 7157c6ed4c606fa98e729e7082602f9ebac226cd
3 changes: 2 additions & 1 deletion httpx/_urls.py
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
import idna

from ._types import QueryParamTypes
from ._urlparse import urlparse
from ._urlparse import ParseResult, urlparse
from ._utils import primitive_value_to_str

__all__ = ["URL", "QueryParams"]
@@ -113,6 +113,7 @@ def __init__(self, url: URL | str | typing.Any = "", **kwargs: typing.Any) -> No
params = kwargs.pop("params")
kwargs["query"] = None if not params else str(QueryParams(params))

self._uri_reference: ParseResult
if isinstance(url, URL):
self._uri_reference = url._uri_reference.copy_with(**kwargs)
else: