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