From 376bdfe902a205df8ba11958394d9a62bbf9ba7a Mon Sep 17 00:00:00 2001 From: Yufeng Yang Date: Thu, 23 Dec 2021 15:32:28 -0500 Subject: [PATCH] item_39 --- exercise/item_39.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 exercise/item_39.py diff --git a/exercise/item_39.py b/exercise/item_39.py new file mode 100644 index 0000000..2f9d982 --- /dev/null +++ b/exercise/item_39.py @@ -0,0 +1,29 @@ + + +class InputData + def read(self): + raise NotImplementedError + +class PathInputData(InputData): + def __init__(self, path): + super().__init__() + self.path = path + + def read(self): + with open(self.path) as f: + return f.read() + +class Worker: + def __init__(self, input_data): + self.input_data = input_data + self.result = None + + def map(self): + raise NotImplementedError + + def reduce(self, other): + raise NotImplementedError + + + +