Skip to content

Commit bbe9284

Browse files
committed
| None
1 parent e78a06c commit bbe9284

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/causalprog/_abc/labelled.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ class Labelled(ABC):
1212
"""
1313

1414
__slots__ = ("_label",)
15-
_label: str
15+
_label: str | None
1616

1717
@property
1818
def label(self) -> str:
1919
"""Label of this object."""
20+
if self._label is None:
21+
msg = "Node has no label."
22+
raise ValueError(msg)
2023
return self._label
2124

2225
def __init__(self, *, label: str | None) -> None:

0 commit comments

Comments
 (0)