Fixed return type hinting required by pre commit for evaluate function

Signed-off-by: Arijit De <arijitde2050@gmail.com>
This commit is contained in:
Arijit De 2023-05-30 16:11:49 +05:30
parent 800b07a34c
commit 70fd7fd5fe

View File

@ -74,7 +74,7 @@ def is_operator(data: str) -> bool:
return data in ["-", "+", "*", "^", "/"]
def evaluate(post_fix: list, verbose: bool = False) -> int:
def evaluate(post_fix: list, verbose: bool = False) -> int | float | str | None:
"""
Function that evaluates postfix expression using a stack.
>>> evaluate(["2", "1", "+", "3", "*"])