diff --git a/tools/aoc.py b/tools/aoc.py index 08f8449..c54aeac 100644 --- a/tools/aoc.py +++ b/tools/aoc.py @@ -168,17 +168,17 @@ class AOCDay: answer_cache.save() - def getInput(self) -> Union[str, List]: + def getInput(self, return_type: Type = None) -> Any: if len(self.input) == 1: - return self.input[0] + if return_type: + return return_type(self.input[0]) + else: + return self.input[0] else: - return self.input.copy() - - def getInputListAsType(self, return_type: Type) -> List: - """ - get input as list casted to return_type, each line representing one list entry - """ - return [return_type(i) for i in self.input] + if return_type: + return [return_type(i) for i in self.input] + else: + return self.input.copy() def getMultiLineInputAsArray(self, return_type: Type = None, join_char: str = None) -> List: """