Use guarded_eval for the callable in python_func_kw_matches - #15338
Open
sage-mode-hunter wants to merge 1 commit into
Open
Use guarded_eval for the callable in python_func_kw_matches#15338sage-mode-hunter wants to merge 1 commit into
sage-mode-hunter wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Keyword completion is the one evaluation site left in the completer that never consulted the policy:
python_func_kw_matchesresolves the callable with a bareeval(), whileglobal_matches,_evaluate_exprand the dict key matcher all go throughguarded_evalpython_func_kw_matcheris in the default matcher list, soobj.attr(plus Tab runs a property getter or a custom__getattr__with no cell executedguarded_evalrefuses that same attribute access under the defaultlimitedpolicy, so the two currently disagree about the same expressionRouted it through the
EvaluationContextthe sibling matchers already build. Plain functions and ordinary methods still complete their keywords, and the eager behaviour stays available underevaluation="unsafe".