Title: Enum.value treated as Enum · Issue #3546 · python/mypy · GitHub
Open Graph Title: Enum.value treated as Enum · Issue #3546 · python/mypy
X Title: Enum.value treated as Enum · Issue #3546 · python/mypy
Description: Hi guys, I couldn't find a similar issue, so apologies if there is a similar issue already open or closed. Why doesn't this example show an error for wrong argument type in the last line: import enum class TempEnum(enum.Enum): one = 1 tw...
Open Graph Description: Hi guys, I couldn't find a similar issue, so apologies if there is a similar issue already open or closed. Why doesn't this example show an error for wrong argument type in the last line: import en...
X Description: Hi guys, I couldn't find a similar issue, so apologies if there is a similar issue already open or closed. Why doesn't this example show an error for wrong argument type in the last line: i...
Opengraph URL: https://github.com/python/mypy/issues/3546
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Enum.value treated as Enum","articleBody":"Hi guys,\r\n\r\nI couldn't find a similar issue, so apologies if there is a similar issue already open or closed.\r\n\r\nWhy doesn't this example show an error for wrong argument type in the last line:\r\n```python\r\nimport enum\r\n\r\nclass TempEnum(enum.Enum):\r\n one = 1\r\n two = 2\r\n\r\ndef test_func(arg: TempEnum) -> None:\r\n print(arg)\r\n \r\ntest_func(TempEnum.one.value) # No error ?\r\n```\r\nShouldn't this be an error as .value is an int?\r\nI'm using Python 3.5 and mypy 0.511.\r\n\r\nMatic\r\n","author":{"url":"https://github.com/matkuki","@type":"Person","name":"matkuki"},"datePublished":"2017-06-14T23:23:32Z","url":"https://github.com/python/mypy/issues/3546"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:040b76c0-cce0-9a65-6499-3d0605ecd96a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AA2E:59CDA:36629BF:47EB612:6B0046F5 |
| html-safe-nonce | 88ccd6cfeae9164ea8a0a3f42af7cdccb11c938763ba7ae2ebe6951fef1ed97a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQTJFOjU5Q0RBOjM2NjI5QkY6NDdFQjYxMjo2QjAwNDZGNSIsInZpc2l0b3JfaWQiOiI5MjA4ODcyNDA1MTUyMzE5MjIxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6a90e09c642ad3799b6b9585623d66e54e6b3d36c3aa3e5d792d1ad61f183c6a |
| hovercard-subject-tag | issue:236036825 |
| 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/python/mypy/3546/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c6d4c41cbdb129f3a3a7ef2e80d012b51193908ed66e20fc96921a490853fb3b/python/mypy/issues/3546 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c6d4c41cbdb129f3a3a7ef2e80d012b51193908ed66e20fc96921a490853fb3b/python/mypy/issues/3546 |
| og:image:alt | Hi guys, I couldn't find a similar issue, so apologies if there is a similar issue already open or closed. Why doesn't this example show an error for wrong argument type in the last line: import en... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | matkuki |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| 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 | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width