diff --git a/mapytex/calculus/core/operator.py b/mapytex/calculus/core/operator.py index 21ce8d8..5cac730 100644 --- a/mapytex/calculus/core/operator.py +++ b/mapytex/calculus/core/operator.py @@ -35,6 +35,22 @@ OPERATORS = { }, } +def is_operator(string): + """ Return whether a string is an operator or not + + :param string: string to test + :returns: boolean + + :example: + + >>> is_operator("+") + True + >>> is_operator("i") + False + + """ + return string in OPERATORS.keys() + # ----------------------------- # Reglages pour 'vim'