Skip to content

Commit 7efb605

Browse files
committed
Fix memento
1 parent 5813be0 commit 7efb605

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Memento/Conceptual/main.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
from abc import ABC, abstractmethod
1717
from datetime import datetime
1818
from random import sample
19-
from string import ascii_letters, digits
19+
from string import ascii_letters
2020

2121

22-
class Originator():
22+
class Originator:
2323
"""
2424
EN: The Originator holds some important state that may change over time. It
2525
also defines a method for saving the state inside a memento and another
@@ -57,7 +57,8 @@ def do_something(self) -> None:
5757
self._state = self._generate_random_string(30)
5858
print(f"Originator: and my state has changed to: {self._state}")
5959

60-
def _generate_random_string(self, length: int = 10) -> None:
60+
@staticmethod
61+
def _generate_random_string(length: int = 10) -> str:
6162
return "".join(sample(ascii_letters, length))
6263

6364
def save(self) -> Memento:
@@ -128,7 +129,7 @@ def get_date(self) -> str:
128129
return self._date
129130

130131

131-
class Caretaker():
132+
class Caretaker:
132133
"""
133134
EN: The Caretaker doesn't depend on the Concrete Memento class. Therefore,
134135
it doesn't have access to the originator's state, stored inside the memento.

0 commit comments

Comments
 (0)