Make classes more generic

This commit is contained in:
Joscha 2019-06-03 15:55:58 +00:00
parent f4c0416398
commit 052bbfb6d2
5 changed files with 265 additions and 0 deletions

17
cheuph/element.py Normal file
View file

@ -0,0 +1,17 @@
from dataclasses import dataclass
from typing import Hashable, Optional
__all__ = ["Id", "Element", "RenderedElement"]
Id = Hashable
@dataclass
class Element:
id: Id
parent_id: Optional[Id]
@dataclass
class RenderedElement:
id: Id
meta: AttributedText
lines: List[AttributedText]