refactor: args

This commit is contained in:
Dan Chen
2024-03-21 15:20:09 +08:00
parent 49659dcc13
commit 726b926d98
6 changed files with 22 additions and 13 deletions

View File

@ -7,7 +7,8 @@ class Calculator(Blackbox):
"""This class just for example, it show how to implement Blackbox interface."""
def valid(self, data: any) -> bool:
def valid(self, *args, **kwargs) -> bool:
data = args[0]
return isinstance(data, dict) and "op" in data and "left" in data and "right" in data
def processing(self, data: dict) -> int | float: