Merged
Conversation
charisk
approved these changes
Apr 8, 2024
Contributor
charisk
left a comment
There was a problem hiding this comment.
The changes seem reasonable based on what you've described in the PR description.
Do you think it's worth adding some unit tests around this functionality?
Member
Author
Yes, good call. I'll add some unit tests in a follow-up PR. |
3 tasks
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.
This improves support for Python arguments by doing two things:
It is possible to call the function as normal
foo(1, 2), which works withArgument[0]andArgument[1]. However, it's also possible to call this likefoo(1, y = 2)orfoo(x = 1, y = 2), which doesn't work for those same values (since the function definition isn't always available). Therefore, this changes the generation of these arguments toArgument[0,x:]andArgument[1,y:].It is not possible to call this like
foo(x = 5, y = 2), only asfoo(5, 2)orfoo(5, y = 2). So, unlike above, we should ensure that these arguments are not modeled as bothArgument[0]andArgument[x:], but only asArgument[0].The CodeQL query will return
x/,yas the parameter string for this function. When there are multiple positional-only arguments, each argument name will be suffixed by/.Checklist
ready-for-doc-reviewlabel there.