Skip to content
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

Merged
merged 6 commits into from
Jun 3, 2019
Merged

fix(python): support variadic arguments #513

merged 6 commits into from
Jun 3, 2019

Conversation

garnaat
Copy link
Contributor

@garnaat garnaat commented Jun 3, 2019

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.

@garnaat garnaat requested review from dstufft and a team as code owners June 3, 2019 13:26
@@ -472,7 +472,13 @@ abstract class BaseMethod implements PythonBase {
paramNames.push(toPythonParameterName(param.name));
}
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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));
}

Copy link
Contributor

@eladb eladb left a 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

@garnaat garnaat changed the title Fix variadic args in Python fix(python): support variadic arguments Jun 3, 2019
@garnaat garnaat merged commit 695ca6b into aws:master Jun 3, 2019
@garnaat garnaat deleted the fix-483 branch June 3, 2019 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python: Ec2Service.placeSpreadAccross example is broken
2 participants