Title: Fix kwarg func resolution by jmlidbetter · Pull Request #1136 · pythonnet/pythonnet · GitHub
Open Graph Title: Fix kwarg func resolution by jmlidbetter · Pull Request #1136 · pythonnet/pythonnet
X Title: Fix kwarg func resolution by jmlidbetter · Pull Request #1136 · pythonnet/pythonnet
Description: What does this implement/fix? Explain your changes. A first run at fixing issue #1097. Currently, the method for selecting which method to use is quite simple and just takes the first function it finds to match. The problem is that the current picking algorithm has no knowledge of kwargs and how many have been supplied or used, i.e. MatchesArgumentCount will return true even if we've supplied some kwargs but the current overload does not require them. Ultimately, this means the first matched method might not be the best. This small patch aims to rectify this issue by collecting together all the methods for which MatchesArgumentCount returns true and then from these selecting the best match based on the following criteria Maximizing the number of supplied kwargs that have been used Minimizing the number of default arguments needed It also has some logic to abort in the case where The above criteria are met by more than one overload We need at least one default argument to make the call This stops users in python making ambiguous function calls - see the tests for an example. Does this close any currently open issues? #1097 Any other comments? Feedback please! 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
Open Graph Description: What does this implement/fix? Explain your changes. A first run at fixing issue #1097. Currently, the method for selecting which method to use is quite simple and just takes the first function it f...
X Description: What does this implement/fix? Explain your changes. A first run at fixing issue #1097. Currently, the method for selecting which method to use is quite simple and just takes the first function it f...
Opengraph URL: https://github.com/pythonnet/pythonnet/pull/1136
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:736f2191-13b1-0d6f-be4b-74b64f8e1f1e |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | DE1A:2D93F8:21A5DFF:2D9C70F:6970861D |
| html-safe-nonce | b63a89d4b6b43cd8d723227549300ed56d26f3146925f58e026f1d05e5135d10 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTFBOjJEOTNGODoyMUE1REZGOjJEOUM3MEY6Njk3MDg2MUQiLCJ2aXNpdG9yX2lkIjoiMTEyNzgyMjgyOTg5NDUzNDY4NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ee182d1110b82bf8214cffb88597c6998d8ec0833077e96e68902d98e6679c30 |
| hovercard-subject-tag | pull_request:414560789 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/pythonnet/pythonnet/pull/1136/checks |
| twitter:image | https://avatars.githubusercontent.com/u/53430310?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/53430310?s=400&v=4 |
| og:image:alt | What does this implement/fix? Explain your changes. A first run at fixing issue #1097. Currently, the method for selecting which method to use is quite simple and just takes the first function it f... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9920a62ba22d06470388e2904804fb7e5ec51c9e35f81784e9191394c74b2bd2 |
| turbo-cache-control | no-preview |
| go-import | github.com/pythonnet/pythonnet git https://github.com/pythonnet/pythonnet.git |
| octolytics-dimension-user_id | 6050430 |
| octolytics-dimension-user_login | pythonnet |
| octolytics-dimension-repository_id | 14748123 |
| octolytics-dimension-repository_nwo | pythonnet/pythonnet |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 14748123 |
| octolytics-dimension-repository_network_root_nwo | pythonnet/pythonnet |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7d6181066430cc06553c8396ca201e194ae33cb9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width