Fix type annotations for stack.py (#5566)

This commit is contained in:
Edward Nuno
2021-10-26 11:33:08 -07:00
committed by GitHub
parent 582f57f41f
commit c0ed031b3f
4 changed files with 15 additions and 11 deletions

View File

@@ -38,7 +38,7 @@ def infix_to_postfix(expression_str: str) -> str:
"""
if not balanced_parentheses(expression_str):
raise ValueError("Mismatched parentheses")
stack = Stack()
stack: Stack[str] = Stack()
postfix = []
for char in expression_str:
if char.isalpha() or char.isdigit():