-
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): unable to override methods with keyword arguments #3695
Conversation
The callback logic in the jsii runtime library for Python was incorrectly passing keyword arguments to Python implementations, forwarding a struct instance as-is instead of destructuring it into a keyword arguments mapping. Using `inspect.signature()`, detect the presence of keyword arguments on the callback target, and destructure the struct as relevant. Fixes #3656
}, | ||
{ | ||
"login": "gshpychka", | ||
"name": "Glib Shpychka", | ||
"avatar_url": "https://avatars.githubusercontent.com/u/23005347?v=4", | ||
"profile": "https://github.com/gshpychka", | ||
"contributions": [ | ||
"bug" | ||
] |
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.
0.02$: This change seems unrelated to the fix
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.
This is the record for the individual who's reported this bug... Need I submit 2 separate PRs?
Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it! |
Merging (with squash)... |
The callback logic in the jsii runtime library for Python was
incorrectly passing keyword arguments to Python implementations,
forwarding a struct instance as-is instead of destructuring it into a
keyword arguments mapping.
Using
inspect.signature()
, detect the presence of keyword arguments onthe callback target, and destructure the struct as relevant.
Fixes #3656
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.