-
Notifications
You must be signed in to change notification settings - Fork 245
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
fix(python): support variadic arguments #513
Conversation
@@ -472,7 +472,13 @@ abstract class BaseMethod implements PythonBase { | |||
paramNames.push(toPythonParameterName(param.name)); | |||
} |
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.
Wouldn't it make more sense to simply check if param.variadic
is true here and push a different value to paramNames
?
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.
Yeah. I started with a change proposed in the original issue. Meant to clean it up but forgot. Testing my updates now.
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.
What I meant is that you can just add this condition when paramNames
is being created in the first place (line 471):
for (const param of this.parameters) {
paramNames.push((param.variadic ? '*' : '') + toPythonParameterName(param.name));
}
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.
Please make sure PR & commit title use conventional commits:
fix(python): support variadic arguments
Fixes #483
Handles variadic args and adds a test of VariadicMethod to the compliance tests.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.