feat: runtime

This commit is contained in:
Dan Chen
2024-03-21 15:13:32 +08:00
parent e914aeee32
commit 49659dcc13
6 changed files with 339 additions and 4 deletions

View File

@ -10,7 +10,7 @@ class Calculator(Blackbox):
def valid(self, data: any) -> bool:
return isinstance(data, dict) and "op" in data and "left" in data and "right" in data
def processing(self, data: dict) -> any:
def processing(self, data: dict) -> int | float:
if not self.valid(data):
raise ValueError("Invalid data")
a = data["left"]