diff --git a/CHANGES/891.bugfix.rst b/CHANGES/891.bugfix.rst new file mode 100644 index 000000000..b73534e0f --- /dev/null +++ b/CHANGES/891.bugfix.rst @@ -0,0 +1 @@ +Updated type hints to include `URL.missing_port`, `URL.__bytes__` and the `encoding` argument to `URL.joinpath()` diff --git a/yarl/__init__.pyi b/yarl/__init__.pyi index dac481d46..5fd4bd0d1 100644 --- a/yarl/__init__.pyi +++ b/yarl/__init__.pyi @@ -25,6 +25,7 @@ class URL: raw_host: Final[Optional[str]] host: Final[Optional[str]] port: Final[Optional[int]] + explicit_port: Final[Optional[int]] raw_authority: Final[str] authority: Final[str] raw_path: Final[str] @@ -66,6 +67,7 @@ class URL: ) -> URL: ... def __str__(self) -> str: ... def __repr__(self) -> str: ... + def __bytes__(self) -> bytes: ... def __eq__(self, other: Any) -> bool: ... def __le__(self, other: Any) -> bool: ... def __lt__(self, other: Any) -> bool: ... @@ -96,7 +98,7 @@ class URL: def with_name(self, name: str) -> URL: ... def with_suffix(self, suffix: str) -> URL: ... def join(self, url: URL) -> URL: ... - def joinpath(self, *url: str) -> URL: ... + def joinpath(self, *url: str, encoded: bool = ...) -> URL: ... def human_repr(self) -> str: ... # private API @classmethod