simpleeval
simpleeval copied to clipboard
Simple Safe Sandboxed Extensible Expression Evaluator for Python
We tested that cache ast parsing result reduced more than 50% run time for our user case, it would be great if it can be merged. The cache is an...
Should allow the use cases outlined in https://github.com/danthedeckie/simpleeval/issues/25 Basically the expressions that have already gone through `ast.parse` are cached in the SimpleEval class. Whenever `eval` is called it checks if...
* There must be exactly one statement in input * Given statement must be an expression (assignment, augmented assignment, etc. are not allowed) Resolves #58 #65 #67
`simpleeval 0.9.10` So I just remembered that any valid assignment target can be used in a list comprehension! i.e. something like `[... for foo[0] in ...]` is valid syntax. ###...
The following statement successfully executes. `simpleeval.simple_eval("a = 2")` And returns 2. I suggest that assignment operator is entirely disallowed as input to simple eval. Because "a == 2" can be...
Using `simple_eval` method expression like `True\nFalse` is evaluated to True, `False\nTrue` to False. It looks like only the first statement is taken from AST for evaluation. https://github.com/danthedeckie/simpleeval/blob/b47858d7153a05f64da16c4425c38f481e510d12/simpleeval.py#L328 I suggest that...
so you could do: >>> s = SimpleEval() >>> s('22 + 20') 42 which would be rather sweet.
This PR adds support for star-expresions when unpacking dicts and lists, e.g. `{'a': 0, **x, 'c': 3}` or `['a', *x, 'b']`. ~I am not sure if `ast.Starred` is available in...
Documentation on your simpleeval package (on github) has an explanation on how add `^` operator, but lacks an example of how `operators` paramater work is through a `dict` with `lambda`,...
# Description Drop CI testing for Python 2.7 and Python 3.6, which have both reached end-of-life status. In addition, this adds a CHANGELOG, which is critical file to have for...