Skip to content

Commit 89a5309

Browse files
style: Add type hints
1 parent cefb617 commit 89a5309

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

mailgun/client.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,11 @@ def __init__(self, api_url: str | None = None) -> None:
514514
self.ex_handler: bool = True
515515
base_url_input: str = api_url or self.DEFAULT_API_URL
516516

517-
self.api_url = self._normalize_api_url(base_url_input)
517+
self.api_url: str = self._normalize_api_url(base_url_input)
518518

519-
self._baked_urls = {ver.value: f"{self.api_url}/{ver.value}" for ver in APIVersion}
519+
self._baked_urls: Final[dict[str, str]] = {
520+
ver.value: f"{self.api_url}/{ver.value}" for ver in APIVersion
521+
}
520522

521523
@staticmethod
522524
def _normalize_api_url(raw_url: str) -> str:
@@ -534,7 +536,7 @@ def _normalize_api_url(raw_url: str) -> str:
534536
Raises:
535537
ApiError: If an ambiguous API version is found embedded within the custom path.
536538
"""
537-
safe_url = SecurityGuard.sanitize_api_url(raw_url)
539+
safe_url: str = SecurityGuard.sanitize_api_url(raw_url)
538540

539541
parsed = urlparse(safe_url)
540542
path_segments = [seg for seg in parsed.path.split("/") if seg]

0 commit comments

Comments
 (0)