diff --git a/hcloud/core/domain.py b/hcloud/core/domain.py index 6659df80..cf7ddd19 100644 --- a/hcloud/core/domain.py +++ b/hcloud/core/domain.py @@ -1,7 +1,7 @@ from __future__ import annotations from datetime import datetime -from typing import Any, overload +from typing import Any, TypeVar, overload from dateutil.parser import isoparse @@ -12,12 +12,14 @@ "Meta", ] +T = TypeVar("T", bound="BaseDomain") + class BaseDomain: __api_properties__: tuple[str, ...] @classmethod - def from_dict(cls, data: dict[str, Any]): # type: ignore[no-untyped-def] + def from_dict(cls: type[T], data: dict[str, Any]) -> T: """ Build the domain object from the data dict. """ diff --git a/hcloud/isos/domain.py b/hcloud/isos/domain.py index 5fd50c6e..9ce845af 100644 --- a/hcloud/isos/domain.py +++ b/hcloud/isos/domain.py @@ -72,4 +72,4 @@ def deprecated(self) -> datetime | None: ) if self.deprecation is None: return None - return self.deprecation.unavailable_after # type: ignore[no-any-return] + return self.deprecation.unavailable_after