From f7f51b34137b56380ec7de304b7e5deb224f83a8 Mon Sep 17 00:00:00 2001 From: Salvo 'LtWorf' Tomaselli Date: Wed, 12 Aug 2020 15:26:56 +0200 Subject: [PATCH] Make mypy happy --- relational/parser.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/relational/parser.py b/relational/parser.py index e95d27f..143edf5 100644 --- a/relational/parser.py +++ b/relational/parser.py @@ -309,7 +309,7 @@ def parse_tokens(expression: List[Union[list, str]]) -> Node: if len(expression[i + 1:]) == 0: raise ParserException( f'Expected right operand for {expression[i]!r}') - return Binary(expression[i], parse_tokens(expression[:i]), parse_tokens(expression[i + 1:])) + return Binary(expression[i], parse_tokens(expression[:i]), parse_tokens(expression[i + 1:])) # type: ignore '''Searches for unary operators, parsing from right to left''' for i in range(len(expression) - 1, -1, -1): if expression[i] in u_operators: # Unary operator @@ -318,9 +318,9 @@ def parse_tokens(expression: List[Union[list, str]]) -> Node: f'Expected more tokens in {expression[i]!r}') return Unary( - expression[i], - prop=expression[1 + i].strip(), - child=parse_tokens(expression[2 + i]) + expression[i], # type: ignore + prop=expression[1 + i].strip(), # type: ignore + child=parse_tokens(expression[2 + i]) # type: ignore ) raise ParserException(f'Parse error on {expression!r}')