def METHOD_NAME(self, key: str, type_: type, typestr: str) -> None:
    assert key in self._raw
    if not isinstance(self._raw[key], type_):
        raise TypeError(
            f"'{self._name}' member '{key}' must be a {typestr}"
        )