mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
Improve urllib3.util.url annotations (#8460)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import Any
|
||||
from typing import NamedTuple
|
||||
|
||||
from .. import exceptions
|
||||
|
||||
@@ -6,8 +6,16 @@ LocationParseError = exceptions.LocationParseError
|
||||
|
||||
url_attrs: list[str]
|
||||
|
||||
class Url:
|
||||
slots: Any
|
||||
class _UrlBase(NamedTuple):
|
||||
auth: str | None
|
||||
fragment: str | None
|
||||
host: str | None
|
||||
path: str | None
|
||||
port: str | None
|
||||
query: str | None
|
||||
scheme: str | None
|
||||
|
||||
class Url(_UrlBase):
|
||||
def __new__(
|
||||
cls,
|
||||
scheme: str | None = ...,
|
||||
@@ -27,6 +35,6 @@ class Url:
|
||||
@property
|
||||
def url(self) -> str: ...
|
||||
|
||||
def split_first(s, delims): ...
|
||||
def split_first(s: str, delims: str) -> tuple[str, str, str | None]: ...
|
||||
def parse_url(url: str) -> Url: ...
|
||||
def get_host(url): ...
|
||||
def get_host(url: str) -> tuple[str, str | None, str | None]: ...
|
||||
|
||||
Reference in New Issue
Block a user