axiacore / py-expression-eval

MIT License
149 stars 54 forks source link

Min/max for single integer. #71

Open AbdulMagomedov opened 2 years ago

AbdulMagomedov commented 2 years ago

It is not possible to calculate min(x) or max(x) with a single integer. It is required to wrap it in tuple: Input: parser.parse('min(x)').evaluate({"x": 3}) or parser.parse('min(3)').evaluate({}) Result: TypeError: 'int' object is not iterable

Despite this number can be parsed: Input: parser.parse('min(x)') or parser.parse('min(3)') Result: <py_expression_eval.Expression object at 0x7fd984ad8f10>