1
0
forked from clan/clan-core

add assertion if FlakeId has wrong value

This commit is contained in:
Jörg Thalheim 2024-07-03 17:24:35 +02:00
parent c44a99e304
commit d9c5f16e05

View File

@ -12,6 +12,11 @@ class FlakeId:
# FIXME: this is such a footgun if you accidnetally pass a string
_value: str | Path
def __post_init__(self) -> None:
assert isinstance(
self._value, str | Path
), f"Flake {self._value} has an invalid type: {type(self._value)}"
def __str__(self) -> str:
return str(
self._value