Skip to content

Commit

Permalink
refactor: add leading underscore to private functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mecaneer23 committed Dec 31, 2023
1 parent 8760198 commit 7296ea0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/class_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from src.class_todo import Todo, Todos, TodoList


class Restorable:
class _Restorable:
def __init__(self, todos: Todos, selected: int) -> None:
self.stored: str = " |SEP|".join([todo.text for todo in todos])
self.selected: int = selected
Expand All @@ -18,11 +18,11 @@ def __repr__(self) -> str:

class UndoRedo:
def __init__(self) -> None:
self.history: list[Restorable] = []
self.history: list[_Restorable] = []
self.index: int = -1

def add(self, todos: Todos, selected: int) -> None:
self.history.append(Restorable(todos, selected))
self.history.append(_Restorable(todos, selected))
self.index = len(self.history) - 1

def undo(self) -> TodoList:
Expand Down

0 comments on commit 7296ea0

Please sign in to comment.