Skip to content

Commit

Permalink
Update type hints
Browse files Browse the repository at this point in the history
- `explicit_port` and `__bytes__` were missing
- `joinpath()` takes an optional `encoded` argument
  • Loading branch information
mjpieters committed Jun 14, 2023
1 parent c20808a commit d61a106
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES/891.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated type hints to include `URL.missing_port`, `URL.__bytes__` and the `encoding` argument to `URL.joinpath()`
4 changes: 3 additions & 1 deletion yarl/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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: ...
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d61a106

Please sign in to comment.