simplify dict key checks (SIM118)

This commit is contained in:
Daniel Eades 2022-01-09 16:44:07 +00:00 committed by Adam Turner
parent af425c069f
commit 0bf661857d
3 changed files with 3 additions and 3 deletions

View File

@ -2531,7 +2531,7 @@ class DefinitionParser(BaseParser):
while not self.eof:
if (len(symbols) == 0 and self.current_char in end):
break
if self.current_char in brackets.keys():
if self.current_char in brackets:
symbols.append(brackets[self.current_char])
elif len(symbols) > 0 and self.current_char == symbols[-1]:
symbols.pop()

View File

@ -5754,7 +5754,7 @@ class DefinitionParser(BaseParser):
while not self.eof:
if (len(symbols) == 0 and self.current_char in end):
break
if self.current_char in brackets.keys():
if self.current_char in brackets:
symbols.append(brackets[self.current_char])
elif len(symbols) > 0 and self.current_char == symbols[-1]:
symbols.pop()

View File

@ -379,7 +379,7 @@ class BaseParser:
while not self.eof:
if len(symbols) == 0 and self.current_char in end:
break
if self.current_char in brackets.keys():
if self.current_char in brackets:
symbols.append(brackets[self.current_char])
elif len(symbols) > 0 and self.current_char == symbols[-1]:
symbols.pop()