From 1988d5b0e02bf0e1850335daffa9c4f88f25834d Mon Sep 17 00:00:00 2001 From: mecaneer23 Date: Wed, 31 Jan 2024 11:17:53 -0600 Subject: [PATCH] feature: make _Restorable separator its own variable to increase readability --- src/class_history.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/class_history.py b/src/class_history.py index 807952d..2f2a137 100644 --- a/src/class_history.py +++ b/src/class_history.py @@ -4,16 +4,18 @@ class _Restorable: + SEPARATOR = " |SEP|" + def __init__(self, todos: Todos, selected: int) -> None: - self.stored: str = " |SEP|".join([todo.text for todo in todos]) + self.stored: str = self.SEPARATOR.join([todo.text for todo in todos]) self.selected: int = selected def get(self) -> TodoList: - stored = self.stored.split(" |SEP|") + stored = self.stored.split(self.SEPARATOR) return TodoList(Todos([Todo(line) for line in stored]), self.selected) def __repr__(self) -> str: - return self.stored.replace(" |SEP|", ", ") + f": {self.selected}" + return self.stored.replace(self.SEPARATOR, ", ") + f": {self.selected}" class UndoRedo: