Python: switch to using @staticmethod
This commit is contained in:
parent
87a29072ef
commit
27f668c968
2 changed files with 9 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue