From 8d49b393c869995a75a08de50a92b0882a09e9c0 Mon Sep 17 00:00:00 2001 From: Salvo 'LtWorf' Tomaselli Date: Wed, 12 Aug 2020 15:16:58 +0200 Subject: [PATCH] Give up on the literals mypy is too stupid to infer them --- relational/parser.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/relational/parser.py b/relational/parser.py index c642f9c..e95d27f 100644 --- a/relational/parser.py +++ b/relational/parser.py @@ -43,10 +43,6 @@ SELECTION = 'σ' RENAME = 'ρ' ARROW = '➡' -BINARY_LITERALS_T = Literal['*', '-', '∪', '∩', '÷', '⋈', '⧑', '⧒', '⧓'] - -UNARY_LITERALS_T = Literal['π', 'σ', 'ρ'] - b_operators = (PRODUCT, DIFFERENCE, UNION, INTERSECTION, DIVISION, JOIN, JOIN_LEFT, JOIN_RIGHT, JOIN_FULL) # List of binary operators @@ -198,7 +194,7 @@ class Variable(Node): @dataclass class Binary(Node): - name: BINARY_LITERALS_T + name: str left: Node right: Node @@ -219,7 +215,7 @@ class Binary(Node): @dataclass class Unary(Node): - name: UNARY_LITERALS_T + name: str prop: str child: Node