From 046db95097a4493160046a47e8fda03ee94b54bc Mon Sep 17 00:00:00 2001 From: "Mr.Hoseini" Date: Wed, 13 May 2026 16:06:00 +0330 Subject: [PATCH 1/3] Add overloads for URL parameter functions --- stubs/Authlib/authlib/common/urls.pyi | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/stubs/Authlib/authlib/common/urls.pyi b/stubs/Authlib/authlib/common/urls.pyi index 969d4bcef05d..deeb1021508a 100644 --- a/stubs/Authlib/authlib/common/urls.pyi +++ b/stubs/Authlib/authlib/common/urls.pyi @@ -1,5 +1,5 @@ from re import Pattern -from typing import Final, TypeAlias +from typing import Final, TypeAlias, overload always_safe: Final[str] urlencoded: Final[set[str]] @@ -9,10 +9,20 @@ _ExplodedQueryString: TypeAlias = list[tuple[str, str]] def url_encode(params: _ExplodedQueryString) -> str: ... def url_decode(query: str) -> _ExplodedQueryString: ... +@overload def add_params_to_qs(query: str, params: _ExplodedQueryString) -> str: ... +@overload +def add_params_to_qs(query: str, params: dict[str, str]) -> str: ... def add_params_to_uri(uri: str, params: _ExplodedQueryString, fragment: bool = False) -> str: ... def quote(s: str, safe: bytes = b"/") -> str: ... def unquote(s: str | bytes) -> str: ... def quote_url(s: str) -> str: ... -def extract_params(raw: dict[str, str] | _ExplodedQueryString) -> _ExplodedQueryString: ... +@overload +def extract_params(raw: None) -> None: ... +@overload +def extract_params(raw: dict[str, str]) -> _ExplodedQueryString: ... +@overload +def extract_params(raw: _ExplodedQueryString) -> _ExplodedQueryString: ... +@overload +def extract_params(raw: str) -> _ExplodedQueryString | None: ... def is_valid_url(url: str, fragments_allowed: bool = True) -> bool: ... From 0aa06b94f5032fbb474abdc1951c6c851f67bfa1 Mon Sep 17 00:00:00 2001 From: "Mr.Hoseini" Date: Wed, 13 May 2026 17:53:28 +0330 Subject: [PATCH 2/3] Update stubs/Authlib/authlib/common/urls.pyi Co-authored-by: Sebastian Rittau --- stubs/Authlib/authlib/common/urls.pyi | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stubs/Authlib/authlib/common/urls.pyi b/stubs/Authlib/authlib/common/urls.pyi index deeb1021508a..bad4a38d9b87 100644 --- a/stubs/Authlib/authlib/common/urls.pyi +++ b/stubs/Authlib/authlib/common/urls.pyi @@ -22,7 +22,5 @@ def extract_params(raw: None) -> None: ... @overload def extract_params(raw: dict[str, str]) -> _ExplodedQueryString: ... @overload -def extract_params(raw: _ExplodedQueryString) -> _ExplodedQueryString: ... -@overload -def extract_params(raw: str) -> _ExplodedQueryString | None: ... +def extract_params(raw: _ExplodedQueryString | tuple[tuple[str, str], ...] | str) -> _ExplodedQueryString | None: ... def is_valid_url(url: str, fragments_allowed: bool = True) -> bool: ... From 9401e14d88a610bf86eaef8fa9ec830e1819dfdd Mon Sep 17 00:00:00 2001 From: "Mr.Hoseini" Date: Wed, 13 May 2026 18:14:29 +0330 Subject: [PATCH 3/3] Update stubs/Authlib/authlib/common/urls.pyi Co-authored-by: Sebastian Rittau --- stubs/Authlib/authlib/common/urls.pyi | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/stubs/Authlib/authlib/common/urls.pyi b/stubs/Authlib/authlib/common/urls.pyi index bad4a38d9b87..051b51f80b92 100644 --- a/stubs/Authlib/authlib/common/urls.pyi +++ b/stubs/Authlib/authlib/common/urls.pyi @@ -9,10 +9,7 @@ _ExplodedQueryString: TypeAlias = list[tuple[str, str]] def url_encode(params: _ExplodedQueryString) -> str: ... def url_decode(query: str) -> _ExplodedQueryString: ... -@overload -def add_params_to_qs(query: str, params: _ExplodedQueryString) -> str: ... -@overload -def add_params_to_qs(query: str, params: dict[str, str]) -> str: ... +def add_params_to_qs(query: str, params: _ExplodedQueryString | dict[str, str]) -> str: ... def add_params_to_uri(uri: str, params: _ExplodedQueryString, fragment: bool = False) -> str: ... def quote(s: str, safe: bytes = b"/") -> str: ... def unquote(s: str | bytes) -> str: ...