MCPcopy Create free account
hub / github.com/RefactoringGuru/design-patterns-python / backup

Method backup

src/Memento/Conceptual/main.py:147–149  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

145 self._originator = originator
146
147 def backup(self) -> None:
148 print("\nCaretaker: Saving Originator's state...")
149 self._mementos.append(self._originator.save())
150
151 def undo(self) -> None:
152 if not len(self._mementos):

Callers 1

main.pyFile · 0.80

Calls 1

saveMethod · 0.80

Tested by

no test coverage detected