Skip to content
Snippets Groups Projects
Commit fa0ace0b authored by Antoine Gaudron-Desjardins's avatar Antoine Gaudron-Desjardins
Browse files

fix lint

parent 45bfda67
No related branches found
No related tags found
No related merge requests found
Pipeline #46272 passed
""" """
Operator module contains the Operator class and a list of standard operators. Operator module contains the Operator class and a list of standard operators.
""" """
class Operator: class Operator:
""" """
Operator class is a binary operator with a symbol, a precedence and an evaluation function. Operator class is a binary operator with a symbol, a precedence and an evaluation function.
""" """
def __init__(self, symbol, precedence, evaluate_function): def __init__(self, symbol, precedence, evaluate_function):
self.symbol = symbol self.symbol = symbol
self.precedence = precedence self.precedence = precedence
...@@ -17,4 +20,5 @@ class Operator: ...@@ -17,4 +20,5 @@ class Operator:
return self.evaluate_function(left, right) return self.evaluate_function(left, right)
STANDARD_OPERATORS = { '+': Operator('+', 1, lambda a, b: a + b),'-': Operator('-', 1, lambda a, b: a - b),'*': Operator('×', 2, lambda a, b: a * b),'/': Operator('/', 2, lambda a, b: a / b)} STANDARD_OPERATORS = {'+': Operator('+', 1, lambda a, b: a + b), '-': Operator('-', 1, lambda a,
b: a - b), '*': Operator('×', 2, lambda a, b: a * b), '/': Operator('/', 2, lambda a, b: a / b)}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment