-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not allow assignment operator #65
Comments
We currently use this functionality and prefer that it continue to be allowed ( see #25 (comment) ) |
(Is the provided comment the correct one?) We can add this validation as optional. Anyway, this assignment thing should be handled in better way because as it is now the assignment target can be anything (variable name is not used anywhere) and can easily introduce errors if second equality sign is missed. |
Yes, that's the comment that I intended to link to but it doesn't tell the whole story. We actually use |
@daveisfera Would https://github.com/danthedeckie/simpleeval/tree/warn_on_assign work for you? As in, not mess up your workflow. It could actually raise an exception which you then over-ride, but I don't want to introduce changes to current behaviour unless it really makes sense to. I've realised that I've really not done a great job up til now of maintaining this. I want to improve that in the future - but it will mean some breaking changes, so my ideal plan at the moment is to lock it down to a 1.0 "stable" release, and then do some refactoring & sanifying (if that's a word) as a 2.0 branch |
I believe that 2.0 version is good idea because a lot of changes looks like breaking ones. |
@PPakalns that sounds great! Thanks for wanting to be part of this 😄 |
Yes, that would be fine because I should be able to override with functions that do the assignment in my "complex wrapper" |
I use the assignment. Please dont remove. Optional is fine with me. |
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 easily mistyped as "a = 2" and existence of variable "a" is not even checked in evaluation of this input.
The text was updated successfully, but these errors were encountered: