From 267afb11565fe62034f93cfd73c36fa301413466 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 4 Sep 2024 09:01:04 -1000 Subject: [PATCH] Fix missing type on URL.port (#1097) --- CHANGES/1097.bugfix.rst | 1 + yarl/_url.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 CHANGES/1097.bugfix.rst diff --git a/CHANGES/1097.bugfix.rst b/CHANGES/1097.bugfix.rst new file mode 100644 index 000000000..1ebcddb05 --- /dev/null +++ b/CHANGES/1097.bugfix.rst @@ -0,0 +1 @@ +Added missing type on :meth:`~yarl.URL.port` -- by :user:`bdraco`. diff --git a/yarl/_url.py b/yarl/_url.py index 0a3961bdb..0153c81be 100644 --- a/yarl/_url.py +++ b/yarl/_url.py @@ -563,7 +563,7 @@ def host(self) -> Optional[str]: return _idna_decode(raw) @cached_property - def port(self): + def port(self) -> Optional[int]: """Port part of URL, with scheme-based fallback. None for relative URLs or URLs without explicit port and