From 66eef16d66388397c41b89fcde9d6ae06a732839 Mon Sep 17 00:00:00 2001 From: Sebastian Kreft Date: Sat, 30 Jul 2022 15:04:45 -0400 Subject: [PATCH] Add annotations to `urrlib3.util.url` (#8448) --- stubs/urllib3/urllib3/util/url.pyi | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/stubs/urllib3/urllib3/util/url.pyi b/stubs/urllib3/urllib3/util/url.pyi index 2d43e2d26..b658bb36c 100644 --- a/stubs/urllib3/urllib3/util/url.pyi +++ b/stubs/urllib3/urllib3/util/url.pyi @@ -4,20 +4,29 @@ from .. import exceptions LocationParseError = exceptions.LocationParseError -url_attrs: Any +url_attrs: list[str] class Url: slots: Any - def __new__(cls, scheme=..., auth=..., host=..., port=..., path=..., query=..., fragment=...): ... + def __new__( + cls, + scheme: str | None = ..., + auth: str | None = ..., + host: str | None = ..., + port: str | None = ..., + path: str | None = ..., + query: str | None = ..., + fragment: str | None = ..., + ): ... @property - def hostname(self): ... + def hostname(self) -> str | None: ... @property - def request_uri(self): ... + def request_uri(self) -> str: ... @property - def netloc(self): ... + def netloc(self) -> str | None: ... @property - def url(self): ... + def url(self) -> str: ... def split_first(s, delims): ... -def parse_url(url): ... +def parse_url(url: str) -> Url: ... def get_host(url): ...