spond_classes.typing
Module containing typing classes.
1"""Module containing typing classes.""" 2 3from typing import Any, TypeAlias 4 5DictFromJSON: TypeAlias = dict[str, Any] 6"""Simple type alias to annotate dicts returned from Spond API calls.""" 7 8 9def _ensure_dict(value: Any) -> None: 10 """Ensure that `value` is a `dict`. 11 12 Raises 13 ------ 14 `TypeError` 15 if `value` is not a `dict`. 16 """ 17 if not isinstance(value, dict): 18 err_msg = f"Expected `dict`, got `{value.__class__.__name__}`: '{value}'" 19 raise TypeError(err_msg)
DictFromJSON: TypeAlias =
dict[str, typing.Any]
Simple type alias to annotate dicts returned from Spond API calls.