Select correct method to invoke when keyword arguments are used by danabr · Pull Request #1242 · pythonnet/pythonnet · GitHub
Skip to content

Select correct method to invoke when keyword arguments are used#1242

Merged
filmor merged 1 commit intopythonnet:masterfrom
danabr:wrong-arity-with-kwargs
Oct 1, 2020
Merged

Select correct method to invoke when keyword arguments are used#1242
filmor merged 1 commit intopythonnet:masterfrom
danabr:wrong-arity-with-kwargs

Conversation

@danabr
Copy link
Copy Markdown
Contributor

@danabr danabr commented Sep 30, 2020

What does this implement/fix? Explain your changes.

If there were two methods with the same name, but with different arity,
Foo(a) and Foo(a,b), and the latter was called with a keyword
argument some.Foo(0, b=1), Foo(0) would be called instead of
Foo(0,1).

Does this close any currently open issues?

Fixes #1235.

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • [] If an enhancement PR, please create docs and at best an example
  • [] Add yourself to AUTHORS
  • Updated the CHANGELOG

If there were two methods with the same name, but with different arity,
`Foo(a)` and `Foo(a,b)`, and the latter was called with a keyword
argument `some.Foo(0, b=1)`, `Foo(0)` would be called instead of
`Foo(0,1)`.

Fixes pythonnet#1235.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 30, 2020

Comment thread src/runtime/constructorbinder.cs
@filmor
Copy link
Copy Markdown
Member

filmor commented Oct 1, 2020

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.

Wrong method chosen if argument is passed as keyword argument

3 participants