Title: .NET enums should not be automatically converted to Python int and back · Issue #1220 · pythonnet/pythonnet · GitHub
Open Graph Title: .NET enums should not be automatically converted to Python int and back · Issue #1220 · pythonnet/pythonnet
X Title: .NET enums should not be automatically converted to Python int and back · Issue #1220 · pythonnet/pythonnet
Description: From #1179 In Python, it should be possible to refer to enum members: MyEnum.Member, and to create arbitrary enum values from int explicitly like this: MyEnum(42). But by default a number and a value of some enum should not be freely con...
Open Graph Description: From #1179 In Python, it should be possible to refer to enum members: MyEnum.Member, and to create arbitrary enum values from int explicitly like this: MyEnum(42). But by default a number and a val...
X Description: From #1179 In Python, it should be possible to refer to enum members: MyEnum.Member, and to create arbitrary enum values from int explicitly like this: MyEnum(42). But by default a number and a val...
Opengraph URL: https://github.com/pythonnet/pythonnet/issues/1220
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":".NET enums should not be automatically converted to Python int and back","articleBody":"From https://github.com/pythonnet/pythonnet/pull/1179\r\n\r\nIn Python, it should be possible to refer to enum members: `MyEnum.Member`, and to create arbitrary enum values from `int` explicitly like this: `MyEnum(42)`. But by default a number and a value of some enum should not be freely convertible to each other. E.g. this should fail:\r\n\r\n```csharp\r\nvoid Method(MyEnum value) =\u003e ...;\r\n```\r\n\r\nPython:\r\n```python\r\nMethod(42); # \u003c- this should be a TypeError\r\n```\r\n\r\nWe can add a generic enum codec, that could be enabled on demand to restore old behavior.\r\n\r\n","author":{"url":"https://github.com/lostmsu","@type":"Person","name":"lostmsu"},"datePublished":"2020-09-13T23:51:52.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/1220/pythonnet/issues/1220"}
| 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:28f6fa46-49bf-7abc-5979-5ac623404197 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 880C:11B887:2BFE085:3B6CFEF:697083A8 |
| html-safe-nonce | a4c51e24d3592ccd7c0b1abee32177a62b0b3d03d632bf19a5b9414d8db5fea2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODBDOjExQjg4NzoyQkZFMDg1OjNCNkNGRUY6Njk3MDgzQTgiLCJ2aXNpdG9yX2lkIjoiMjgzMTMxNjQxODU0OTg1MTI5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a9cb3d08c5194a4b6d3dcff23ffc716148568ae61206df31e4b3d56e0f910294 |
| hovercard-subject-tag | issue:700673520 |
| 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/1220/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0df0959694971d2449320f819efea388d7168666ff2713727a43573c2eb76c69/pythonnet/pythonnet/issues/1220 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0df0959694971d2449320f819efea388d7168666ff2713727a43573c2eb76c69/pythonnet/pythonnet/issues/1220 |
| og:image:alt | From #1179 In Python, it should be possible to refer to enum members: MyEnum.Member, and to create arbitrary enum values from int explicitly like this: MyEnum(42). But by default a number and a val... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lostmsu |
| 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