mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-02 18:58:27 +02:00
added dict to safe_eval
This commit is contained in:
parent
f451f3bf51
commit
677fb35427
1 changed files with 3 additions and 3 deletions
|
@ -5,14 +5,14 @@ common_token_map = { # these operators and function are considered safe to use
|
|||
operator: operator
|
||||
for operator in
|
||||
[">=", "<=", "<<", ">>", "+", "-", "*", "/", "%", "**", ",", "(", ")", "[", "]", "==", "!=", "in", ">", "<",
|
||||
"and", "or", "&", "|", "^", "~", ":", "isinstance", "issubclass", "not", "is", "if", "else", "abs", "int",
|
||||
"and", "or", "&", "|", "^", "~", ":", "{", "}", "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"
|
||||
"True", "False", "getattr", "dict"
|
||||
]
|
||||
} | { # these methods are considered safe, except for the magic methods
|
||||
f".{method}": f".{method}"
|
||||
for method in dir(str) + dir(list) + dir(int) + dir(float)
|
||||
for method in dir(str) + dir(list) + dir(int) + dir(float) + dir(dict)
|
||||
if not method.startswith("__")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue