-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Check invalid operations for -k #6854
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
Conversation
The change is very simple check to see if '.' or '[' exists in the |
Thanks a lot @gdhameeja, we appreciate the PR! I replied here #6822 (comment) because I think we should discuss the approach further. 👍 |
@nicoddemus I checked out the comment #6822 (comment) and I understand why checking for '.' isn't such a great idea. I can reference a new PR for changing the expression so it passes eval. |
I think this is a good measure to fix the problem at least while we're still using I agree with @nicoddemus in the issue that we might as well do a full |
`KeywordMapping` returns a bool on lookup which when passed to eval fail on certain operations such as index access and attribute access. We catch all exceptions and raise a `UsageError`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this seems like a good thing to have for now, until/if the eval
goes away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anybody up for backporting this? 😁
I'm up. Although I don't understand what you mean by backporting it and would need a little guidance. |
Since this change just missed the In practice, you want to:
We intend to automate this, but haven't yet... |
#6822
KeywordMapping
returns a bool on lookup which when passed to evalfail on certain operations such as index access and attribute access.
Check has been added to raise a UsageError if such operations are passed
to -k