Title: Enable user classes to override how Python.NET processes parameters of their functions by lostmsu · Pull Request #835 · pythonnet/pythonnet · GitHub
Open Graph Title: Enable user classes to override how Python.NET processes parameters of their functions by lostmsu · Pull Request #835 · pythonnet/pythonnet
X Title: Enable user classes to override how Python.NET processes parameters of their functions by lostmsu · Pull Request #835 · pythonnet/pythonnet
Description: What does this implement/fix? Explain your changes. This change introduces IPyArgumentConverter, that enables hooking into the process of converting Python argument values into CLR types when invoking .NET functions from Python. See an example on the new wiki page. If a user class needs custom conversion for the parameters of its functions, it can specify the desired implementation of IPyArgumentConverter using PyArgConverter attribute either on the class/struct, or for the entire assembly. Does this close any currently open issues? This implements #823 Any other comments? This is but one option on how to achieve #823 . I am concerned, that it does not let users specify the converter per instance, and does not allow specifying converter for 3rd-party classes. This change has an additional performance overhead on the first Bind call on each instance of MethodBinder due to the need to look the attribute up. 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 (see an example) Add yourself to AUTHORS Updated the CHANGELOG
Open Graph Description: What does this implement/fix? Explain your changes. This change introduces IPyArgumentConverter, that enables hooking into the process of converting Python argument values into CLR types when invok...
X Description: What does this implement/fix? Explain your changes. This change introduces IPyArgumentConverter, that enables hooking into the process of converting Python argument values into CLR types when invok...
Opengraph URL: https://github.com/pythonnet/pythonnet/pull/835
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:5296833c-0a43-2030-f10f-618805f381fa |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | AD06:1AD267:23629DB:30FB585:697293AD |
| html-safe-nonce | 89642d4fb0bc066ed18b57418936e6ffd493f9bc9561bd15b2e4a46139127579 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDA2OjFBRDI2NzoyMzYyOURCOjMwRkI1ODU6Njk3MjkzQUQiLCJ2aXNpdG9yX2lkIjoiODkwODEwNzA3NjcyNjg1NDU3MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c7ee8ce370ba74d6a6fcfbe2a1216a3f44d046699afa07da69eca96c4b500107 |
| hovercard-subject-tag | pull_request:265538284 |
| 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/835/checks |
| twitter:image | https://avatars.githubusercontent.com/u/239520?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/239520?s=400&v=4 |
| og:image:alt | What does this implement/fix? Explain your changes. This change introduces IPyArgumentConverter, that enables hooking into the process of converting Python argument values into CLR types when invok... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | f55b89ef71fda443a25c469605964fe31f4313158c4238f900f8894d6f31ffa4 |
| 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 | 69ed002f93fb5a101bb3ef79e8704a63acc02bd2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width