Skip to content

fix(python): support variadic arguments#513

Merged
garnaat merged 6 commits intoaws:masterfrom
garnaat:fix-483
Jun 3, 2019
Merged

fix(python): support variadic arguments#513
garnaat merged 6 commits intoaws:masterfrom
garnaat:fix-483

Conversation

@garnaat
Copy link
Copy Markdown
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 a team and dstufft as code owners June 3, 2019 13:26
@@ -472,7 +472,13 @@ abstract class BaseMethod implements PythonBase {
paramNames.push(toPythonParameterName(param.name));
}
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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