Python: switch to using @staticmethod

This commit is contained in:
akp 2021-11-27 14:02:33 +00:00
parent 87a29072ef
commit 27f668c968
No known key found for this signature in database
GPG key ID: AA5726202C8879B7
2 changed files with 9 additions and 6 deletions

View file

@ -3,11 +3,14 @@ from typing import Any
class BaseChallenge:
def one(self, instr: str) -> Any:
@staticmethod
def one(instr: str) -> Any:
raise NotImplementedError
def two(self, instr: str) -> Any:
@staticmethod
def two(instr: str) -> Any:
raise NotImplementedError
def vis(self, instr: str, outputDir: str) -> Any:
@staticmethod
def vis(instr: str, outputDir: str) -> Any:
raise NotImplementedError

View file

@ -21,11 +21,11 @@ for task in TASKS:
run = None
if taskPart == 1:
run = lambda: Challenge().one(task["input"])
run = lambda: Challenge.one(task["input"])
elif taskPart == 2:
run = lambda: Challenge().two(task["input"])
run = lambda: Challenge.two(task["input"])
elif taskPart == 3:
run = lambda: Challenge().vis(task["input"], task["output_dir"])
run = lambda: Challenge.vis(task["input"], task["output_dir"])
else:
send_result(task_id, False, "unknown task part", 0)
continue