Title: Fix (U)IntPtr construction by filmor · Pull Request #1861 · pythonnet/pythonnet · GitHub
Open Graph Title: Fix (U)IntPtr construction by filmor · Pull Request #1861 · pythonnet/pythonnet
X Title: Fix (U)IntPtr construction by filmor · Pull Request #1861 · pythonnet/pythonnet
Description: What does this implement/fix? Explain your changes. Allows creating an IntPtr from Python. This is currently impossible, because we rely on automatic conversion (as IntPtr is a primitive type) while we don't actually implement one for this type (rightly so!). The relevant code section is: pythonnet/src/runtime/Types/ClassObject.cs Lines 73 to 89 in 87d4db9 if (type.IsPrimitive || type == typeof(string)) { if (Runtime.PyTuple_Size(args) != 1) { Exceptions.SetError(Exceptions.TypeError, "no constructors match given arguments"); return default; } BorrowedReference op = Runtime.PyTuple_GetItem(args, 0); if (!Converter.ToManaged(op, type, out var result, true)) { return default; } return CLRObject.GetReference(result!, tp); } Does this close any currently open issues? #1116 Any other comments? ... 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 Ensure you have signed the .NET Foundation CLA Add yourself to AUTHORS Updated the CHANGELOG
Open Graph Description: What does this implement/fix? Explain your changes. Allows creating an IntPtr from Python. This is currently impossible, because we rely on automatic conversion (as IntPtr is a primitive type) whil...
X Description: What does this implement/fix? Explain your changes. Allows creating an IntPtr from Python. This is currently impossible, because we rely on automatic conversion (as IntPtr is a primitive type) whil...
Opengraph URL: https://github.com/pythonnet/pythonnet/pull/1861
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:c9047304-63ca-b72a-0a5d-470fe3125da6 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | ECF8:30D10E:1276EDA:18617AD:69718B75 |
| html-safe-nonce | f69274c2604468347effaf0bb7ddd54ea6e0cf874ae84b7ecfa1e4715a879c8f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQ0Y4OjMwRDEwRToxMjc2RURBOjE4NjE3QUQ6Njk3MThCNzUiLCJ2aXNpdG9yX2lkIjoiNDk5MDU0ODgzOTE3ODAxMzU1NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | dfa264c9cf3d539952d9d54d5226165e0ed3c8ff7e8c4e560d8264580cae432a |
| hovercard-subject-tag | pull_request:991943191 |
| 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/1861/checks |
| twitter:image | https://avatars.githubusercontent.com/u/30848?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/30848?s=400&v=4 |
| og:image:alt | What does this implement/fix? Explain your changes. Allows creating an IntPtr from Python. This is currently impossible, because we rely on automatic conversion (as IntPtr is a primitive type) whil... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2b0f2f00499ad3dd2c21ad030a3c403edca54df20ea256f6517c6d8c4fa3a1a4 |
| 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 | 67235153f3c1514ed5f7dc469f138abc377bd388 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width