Title: pythonnet 3.0 breaks access to methods whos signature returns an interface but clients want to use the concrete type · Issue #1914 · pythonnet/pythonnet · GitHub
Open Graph Title: pythonnet 3.0 breaks access to methods whos signature returns an interface but clients want to use the concrete type · Issue #1914 · pythonnet/pythonnet
X Title: pythonnet 3.0 breaks access to methods whos signature returns an interface but clients want to use the concrete type · Issue #1914 · pythonnet/pythonnet
Description: Environment Pythonnet version: 3.0+ Python version: any Operating System: any .NET Runtime: any tldr; #1240 changes the behavior of pythonnet to wrap only the interface methods/members of objects returned by a .NET method whose method de...
Open Graph Description: Environment Pythonnet version: 3.0+ Python version: any Operating System: any .NET Runtime: any tldr; #1240 changes the behavior of pythonnet to wrap only the interface methods/members of objects r...
X Description: Environment Pythonnet version: 3.0+ Python version: any Operating System: any .NET Runtime: any tldr; #1240 changes the behavior of pythonnet to wrap only the interface methods/members of objects r...
Opengraph URL: https://github.com/pythonnet/pythonnet/issues/1914
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"pythonnet 3.0 breaks access to methods whos signature returns an interface but clients want to use the concrete type","articleBody":"### Environment\r\n\r\n- Pythonnet version: 3.0+\r\n- Python version: any\r\n- Operating System: any\r\n- .NET Runtime: any\r\n\r\ntldr;\r\n#1240 changes the behavior of pythonnet to wrap only the interface methods/members of objects returned by a .NET method whose method declaration states that it returns an interface. Prior to this change, the python object that pythonnet created for the return object wrapped the returned object instance, but did not necessarily implement the interface. The prior behavior was useful for idiomatic C# patterns like the factory pattern.\r\n\r\nThis was [discussed on the mailing list](https://mail.python.org/archives/list/pythonnet@python.org/thread/2WXCLSE7INFAASKT342N7R7S7EBCM4U5/#E6QPZKWP3DQGGPRW6RBGZH7Q3J3JSQPI) and I wanted to file an issue here.\r\n\r\nApparently, the change was also reverted in the [QuantConnect fork](https://github.com/QuantConnect/pythonnet/commit/da8f3d2fb1cd31b87e94314c0f4e8e26d7086c8d).\r\n\r\n\r\nMy preferred fix, for what its worth, is option 4 (from the list of options mentioned by Victor in that thread):\r\n\u003e IronPython apparently allows explicit interface implementations to be called (instead of returning interface-wrapped instances), if there’s no conflict with regular methods. Perhaps we should consider this as an option.","author":{"url":"https://github.com/koubaa","@type":"Person","name":"koubaa"},"datePublished":"2022-08-15T18:04:15.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/1914/pythonnet/issues/1914"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2e202cee-9e66-655f-95b6-79a311f51fbd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E800:340FCB:20C444D:2C71893:69708437 |
| html-safe-nonce | abc8a695137ca3e43153d4f57cb96eb74b2b5f1fedfc97d9cdac7c3c29e9a236 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODAwOjM0MEZDQjoyMEM0NDREOjJDNzE4OTM6Njk3MDg0MzciLCJ2aXNpdG9yX2lkIjoiNzg3NDE2OTMzODg4Mzc2OTM5OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2d2b0122ae8b29ae2c08ea5b8179d539a8604879c62fff0eef51c94a60a7b8cc |
| hovercard-subject-tag | issue:1339294935 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/pythonnet/pythonnet/1914/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bc7441a004b08d4b9ad5cfda19496b4b0c923aeaba65a860788c9de4c6355ba8/pythonnet/pythonnet/issues/1914 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bc7441a004b08d4b9ad5cfda19496b4b0c923aeaba65a860788c9de4c6355ba8/pythonnet/pythonnet/issues/1914 |
| og:image:alt | Environment Pythonnet version: 3.0+ Python version: any Operating System: any .NET Runtime: any tldr; #1240 changes the behavior of pythonnet to wrap only the interface methods/members of objects r... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | koubaa |
| 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 |
| 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