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

@@ -14,7 +14,7 @@ def balanced_parentheses(parentheses: str) -> bool:
>>> balanced_parentheses("")
True
"""
stack = Stack()
stack: Stack[str] = Stack()
bracket_pairs = {"(": ")", "[": "]", "{": "}"}
for bracket in parentheses:
if bracket in bracket_pairs: