diff --git a/source/safe_eval.py b/source/safe_eval.py index 3c9b0b1..dc6f466 100644 --- a/source/safe_eval.py +++ b/source/safe_eval.py @@ -5,9 +5,10 @@ common_token_map = { # these operators and function are considered safe to use operator: operator for operator in ["+", "-", "*", "/", "%", "**", ",", "(", ")", "[", "]", "==", "!=", "in", ">", "<", ">=", "<=", "and", "or", "&", - "|", "^", "~", "<<", ">>", ":", "not", "is", "if", "else", "abs", "int", "bin", "hex", "oct", "chr", "ord", "len", - "str", "bool", "float", "round", "min", "max", "sum", "zip", "any", "all", "issubclass", "reversed", "enumerate", - "list", "sorted", "hasattr", "for", "range", "type", "isinstance", "repr", "None", "True", "False", "getattr" + "|", "^", "~", "<<", ">>", ":", "isinstance", "issubclass", "not", "is", "if", "else", "abs", "int", + "bin", "hex", "oct", "chr", "ord", "len", "str", "bool", "float", "round", "min", "max", "sum", "zip", + "any", "all", "reversed", "enumerate", "list", "sorted", "hasattr", "for", "range", "type", "repr", "None", + "True", "False", "getattr" ] } | { # these methods are considered safe, except for the magic methods f".{method}": f".{method}"