diff --git a/cheuph/element.py b/cheuph/element.py index ddc0b8e..b7268f3 100644 --- a/cheuph/element.py +++ b/cheuph/element.py @@ -12,39 +12,26 @@ class Element(abc.ABC): def __init__(self, id: Id, parent_id: Optional[Id], - children: Optional[List[Element]], ) -> None: self._id = id - self._parent_id = id + self._parent_id = parent_id - self._children = children @property def id(self) -> Id: return self._id @property - def parent_id(self) -> Id: + def parent_id(self) -> Optional[Id]: return self._parent_id - @property - def children(self) -> List[Element]: - if self._children is None: - raise ElementException("Element doesn't know its children") - - return self._children - - @children.setter - def children(self, children: List[Element]) -> None: - self._children = children - @abc.abstractmethod def render(self, width: int, depth: int, highlighted: bool = False, folded: bool = False, - ) -> RenderedElement: + ) -> "RenderedElement": pass class RenderedElement: