Title: Support indexing and iterating Enum type objects · Issue #741 · python/mypy · GitHub
Open Graph Title: Support indexing and iterating Enum type objects · Issue #741 · python/mypy
X Title: Support indexing and iterating Enum type objects · Issue #741 · python/mypy
Description: Assume this definition of Color: from enum import Enum class Color(Enum): red = 1 green = 2 blue = 3 Now this should be valid, but mypy complains about it: Color['red'] The error message indicates that mypy thinks that the programmer is ...
Open Graph Description: Assume this definition of Color: from enum import Enum class Color(Enum): red = 1 green = 2 blue = 3 Now this should be valid, but mypy complains about it: Color['red'] The error message indicates ...
X Description: Assume this definition of Color: from enum import Enum class Color(Enum): red = 1 green = 2 blue = 3 Now this should be valid, but mypy complains about it: Color['red'] The error message in...
Opengraph URL: https://github.com/python/mypy/issues/741
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support indexing and iterating Enum type objects","articleBody":"Assume this definition of `Color`:\n\n```\nfrom enum import Enum\nclass Color(Enum):\n red = 1\n green = 2\n blue = 3\n```\n\nNow this should be valid, but mypy complains about it:\n\n```\nColor['red']\n```\n\nThe error message indicates that mypy thinks that the programmer is trying to construct a generic type, which is not the case here:\n\n```\n$ mypy t.py\nt.py:8: error: Name 'red' is not defined\n```\n","author":{"url":"https://github.com/JukkaL","@type":"Person","name":"JukkaL"},"datePublished":"2015-08-10T01:58:26Z","url":"https://github.com/python/mypy/issues/741"}
| 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:4ca0931d-7137-ee08-57f7-f792bd3e885b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CD60:16605A:1359652:196F90E:6B000910 |
| html-safe-nonce | 32c2b3dd5750a7db18830a37ca63e581fb96387b6b11b7c4286833078cd47f6d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDYwOjE2NjA1QToxMzU5NjUyOjE5NkY5MEU6NkIwMDA5MTAiLCJ2aXNpdG9yX2lkIjoiMTYwOTE5NzAzOTI2NDk5MTUwNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d72fcfaadab87bfceacc977c87f1fe9b6e670d71e26648dbba406f5f50cb54e9 |
| hovercard-subject-tag | issue:99950998 |
| 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/741/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5dc820dd211be80a394a2f4a93aca01a420f3ed568504a1af4182b1da2c8c466/python/mypy/issues/741 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5dc820dd211be80a394a2f4a93aca01a420f3ed568504a1af4182b1da2c8c466/python/mypy/issues/741 |
| og:image:alt | Assume this definition of Color: from enum import Enum class Color(Enum): red = 1 green = 2 blue = 3 Now this should be valid, but mypy complains about it: Color['red'] The error message indicates ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JukkaL |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| 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 | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width