is_operator function

This commit is contained in:
Bertrand Benjamin 2018-02-02 18:02:42 +03:00
parent a0fa09a381
commit 91bd108b53
1 changed files with 16 additions and 0 deletions

View File

@ -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' # Reglages pour 'vim'