From 70fd7fd5fe192d57e742012049872407ca4b7263 Mon Sep 17 00:00:00 2001 From: Arijit De Date: Tue, 30 May 2023 16:11:49 +0530 Subject: [PATCH] Fixed return type hinting required by pre commit for evaluate function Signed-off-by: Arijit De --- data_structures/stacks/postfix_evaluation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data_structures/stacks/postfix_evaluation.py b/data_structures/stacks/postfix_evaluation.py index dea29858d..bac96cdbc 100644 --- a/data_structures/stacks/postfix_evaluation.py +++ b/data_structures/stacks/postfix_evaluation.py @@ -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", "*"])