danthedeckie / simpleeval

Simple Safe Sandboxed Extensible Expression Evaluator for Python
Other
451 stars 85 forks source link

Operator with arguments?? #89

Closed TheTechRobo closed 3 years ago

TheTechRobo commented 3 years ago

I'd like to have an operator like "?(number)". How would I go about doing this, and if I can't, is it planned and/or are there workarounds?

You might not understand why, but it's so that I can do things like FIBONACCI(2) would get the first 2 fibonacci numbers. it's like functions but as expressions.

TheTechRobo commented 3 years ago

Nevermind, I'm an idiot. Sorry for the noise. I thougyht functiosn could only be used by operators. Which makes no sense since then how do you make operators?