Title: Support casting inf --> System.Double.PositiveInfinity · Issue #100 · pythonnet/pythonnet · GitHub
Open Graph Title: Support casting inf --> System.Double.PositiveInfinity · Issue #100 · pythonnet/pythonnet
X Title: Support casting inf --> System.Double.PositiveInfinity · Issue #100 · pythonnet/pythonnet
Description: Unless I'm mistaken there's no way to pass an infinity through to C# from Python? namespace Demo { public static class TestDoubleCast { public static double PassThru(double arg) { return arg; } } } In [3]: from Demo import TestDoubleCast...
Open Graph Description: Unless I'm mistaken there's no way to pass an infinity through to C# from Python? namespace Demo { public static class TestDoubleCast { public static double PassThru(double arg) { return arg; } } }...
X Description: Unless I'm mistaken there's no way to pass an infinity through to C# from Python? namespace Demo { public static class TestDoubleCast { public static double PassThru(double arg) { return ar...
Opengraph URL: https://github.com/pythonnet/pythonnet/issues/100
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support casting inf --\u003e System.Double.PositiveInfinity","articleBody":"Unless I'm mistaken there's no way to pass an infinity through to C# from Python?\n\n``` csharp\nnamespace Demo {\n public static class TestDoubleCast {\n public static double PassThru(double arg) {\n return arg;\n }\n }\n}\n```\n\n``` python\nIn [3]: from Demo import TestDoubleCast\n\nIn [4]: TestDoubleCast.PassThru(1)\nOut[4]: 1.0\n\nIn [5]: TestDoubleCast.PassThru(3.14159)\nOut[5]: 3.14159\n\nIn [6]: TestDoubleCast.PassThru(inf)\nTraceback (most recent call last):\n\n File \"\u003cipython-input-6-b27dffdb9fe9\u003e\", line 1, in \u003cmodule\u003e\n TestDoubleCast.PassThru(inf)\n\nTypeError: No method matches given arguments\n\n\nIn [7]: TestDoubleCast.PassThru(System.Double.PositiveInfinity)\nTraceback (most recent call last):\n\n File \"\u003cipython-input-9-9828c102a734\u003e\", line 1, in \u003cmodule\u003e\n TestDoubleCast.PassThru(System.Double.PositiveInfinity)\n\nTypeError: No method matches given argument\n\n\nIn [10]: System.Double(3.14159) # works as expected\nOut[10]: \u003cSystem.Double at 0xaf31828\u003e\n\nIn [11]: System.Double(inf) # would like it to return a System.Double\nTraceback (most recent call last):\n\n File \"\u003cipython-input-11-1a15035c8521\u003e\", line 1, in \u003cmodule\u003e\n System.Double(inf)\n\nOverflowError: value too large to convert\n```\n\nIt would be _very_ useful if the casting machinery could special case infinities so that you could create them from Python and they could be passed as arguments to methods expecting a `System.Double`\n","author":{"url":"https://github.com/dhirschfeld","@type":"Person","name":"dhirschfeld"},"datePublished":"2015-09-09T02:38:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/100/pythonnet/issues/100"}
| 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:c4e0b751-2ef5-50d9-dcf7-8d9746284fd2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BDCE:130161:86FD18:ACDC5F:69752BA5 |
| html-safe-nonce | a7c0ede36018cf5dc108bc17ae3abaeb88c5f14c79c70e93c7f15ad6c232b9f9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRENFOjEzMDE2MTo4NkZEMTg6QUNEQzVGOjY5NzUyQkE1IiwidmlzaXRvcl9pZCI6IjUyNzQwMjA5OTcxNTYzODM2NTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b7fc45a1138ebec98d69cf8f3fb79074fac32929fec44f1157758d8af68dc55e |
| hovercard-subject-tag | issue:105506743 |
| 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/100/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b74f782a5cbffa0abdc0193dbed247bcf3af577db4a11bc09bceedfdf98ce953/pythonnet/pythonnet/issues/100 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b74f782a5cbffa0abdc0193dbed247bcf3af577db4a11bc09bceedfdf98ce953/pythonnet/pythonnet/issues/100 |
| og:image:alt | Unless I'm mistaken there's no way to pass an infinity through to C# from Python? namespace Demo { public static class TestDoubleCast { public static double PassThru(double arg) { return arg; } } }... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dhirschfeld |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f |
| 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 | 488b30e96dfd057fbbe44c6665ccbc030b729dde |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width