Compare commits

..

4 Commits

View File

@ -2,8 +2,8 @@
Module implementing message related functions and classes.
"""
import pathlib
from typing import Type, TypeVar, Optional, Any
from dataclasses import dataclass, asdict
from typing import Type, TypeVar, Optional, Any, Final
from dataclasses import dataclass, asdict, field
from .tags import Tag
QuestionInst = TypeVar('QuestionInst', bound='Question')
@ -95,7 +95,7 @@ class Message():
answer: Optional[Answer]
tags: Optional[set[Tag]]
file_path: Optional[pathlib.Path]
file_suffixes: list[str] = ['.txt', '.yaml']
file_suffixes: Final[list[str]] = field(default_factory=lambda: ['.txt', '.yaml'])
# @classmethod
# def from_file(cls: Type[MessageInst], file_path: pathlib.Path) -> MessageInst: