Title: Disable implicit conversion from PyFloat to .NET integer types by lostmsu · Pull Request #1343 · pythonnet/pythonnet · GitHub
Open Graph Title: Disable implicit conversion from PyFloat to .NET integer types by lostmsu · Pull Request #1343 · pythonnet/pythonnet
X Title: Disable implicit conversion from PyFloat to .NET integer types by lostmsu · Pull Request #1343 · pythonnet/pythonnet
Description: What does this implement/fix? Explain your changes. Previously, when a floating point value was passed to .NET parameter of integer type, it would be silently truncated. After this change it would no longer be permitted to pass a floating point value to integer parameter. Does this close any currently open issues? #1342 Any other comments? I removed poorly-behaved PyLong_As* functions, as they would always implicitly convert argument to integer type, which in most cases is undesired behavior. Instead, to avoid roundtrips, PyLong_AsSize_t is used in most cases. The only exception is Int64 which on 32 bit platforms is larger than size_t, so PyLong_AsLongLong function is used after explicit check for PyLong. Draft because it depends on C# 9, which is not yet ready. 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 Updated the CHANGELOG
Open Graph Description: What does this implement/fix? Explain your changes. Previously, when a floating point value was passed to .NET parameter of integer type, it would be silently truncated. After this change it would ...
X Description: What does this implement/fix? Explain your changes. Previously, when a floating point value was passed to .NET parameter of integer type, it would be silently truncated. After this change it would ...
Opengraph URL: https://github.com/pythonnet/pythonnet/pull/1343
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:6aec490e-fc48-8689-97a6-4084c7c65131 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9646:19C1C9:22BD458:2FE8222:6973A713 |
| html-safe-nonce | 64531a0a37ace35ed55f6a3d8c5f1054f3e4883f0c3a20c6376a198e7237ee3c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjQ2OjE5QzFDOToyMkJENDU4OjJGRTgyMjI6Njk3M0E3MTMiLCJ2aXNpdG9yX2lkIjoiNzI4OTIxNzUwNDk1NTgzNjE3OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 292c46528422229558afc6cb11fbc8629d32aec16976c2940315a91dadda1eba |
| hovercard-subject-tag | pull_request:547511170 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/1343/files |
| 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. Previously, when a floating point value was passed to .NET parameter of integer type, it would be silently truncated. After this change it would ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3e9aa9d0c22a21b13b378b4acd09f5dd4876a884425aacd32a9f473b84c8762d |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ae4dbd3ac4179af799d71b75a60b0075ccccc5f6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width