Add type check in name property

This commit is contained in:
2026-05-20 09:11:10 +10:00
parent d4e3be5090
commit e60d9a3173
+4 -1
View File
@@ -50,7 +50,10 @@ class ColourValue(str):
else:
name = ""
return name # ty:ignore[invalid-return-type]
assert isinstance(name, str), \
TypeError(f"`name` should be an instance of `str` not `{type(name)}`")
return name
@property
def hex(self) -> str: