Title: Indexing Enum type objects fails sometimes · Issue #3137 · python/mypy · GitHub
Open Graph Title: Indexing Enum type objects fails sometimes · Issue #3137 · python/mypy
X Title: Indexing Enum type objects fails sometimes · Issue #3137 · python/mypy
Description: Assume this definition of Color: from enum import Enum class Color(Enum): red = 1 green = 2 blue = 3 Color['red'] works, and 'val : Color = Color['red']both work, butval = Color['red']` does not work: error: Name 'red' is not defined err...
Open Graph Description: Assume this definition of Color: from enum import Enum class Color(Enum): red = 1 green = 2 blue = 3 Color['red'] works, and 'val : Color = Color['red']both work, butval = Color['red']` does not wo...
X Description: Assume this definition of Color: from enum import Enum class Color(Enum): red = 1 green = 2 blue = 3 Color['red'] works, and 'val : Color = Color['red']both work, butval = Color...
Opengraph URL: https://github.com/python/mypy/issues/3137
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Indexing Enum type objects fails sometimes","articleBody":"Assume this definition of `Color`:\r\n\r\n```\r\nfrom enum import Enum\r\nclass Color(Enum):\r\n red = 1\r\n green = 2\r\n blue = 3\r\n```\r\n\r\n`Color['red']` works, and 'val : Color = Color['red']` both work, but `val = Color['red']` does not work:\r\n```\r\nerror: Name 'red' is not defined\r\nerror: \"Color\" expects no type arguments, but 1 given\r\n```\r\n\r\nReference #741","author":{"url":"https://github.com/jboning","@type":"Person","name":"jboning"},"datePublished":"2017-04-06T15:52:33Z","url":"https://github.com/python/mypy/issues/3137"}
| 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:7b3c7fd9-6c5a-7231-f942-ea91d02ea3e6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 85B0:CB66E:11CA9F9:1763600:6B000C5B |
| html-safe-nonce | 77a7cb2e07b4e03ce1de1350a811c9338d4d6b1298e9fb5b5adeefce6a579bc6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NUIwOkNCNjZFOjExQ0E5Rjk6MTc2MzYwMDo2QjAwMEM1QiIsInZpc2l0b3JfaWQiOiI4NzQ5NDY5MzExNDY0MTE1MjkxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ee32b950ea3a578ef0ca3405b57ad7d04649091eee778b615f1a4ef2f87ea251 |
| hovercard-subject-tag | issue:219945567 |
| 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/3137/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5525fe53d261fdf6647abc31d3d6116064bf27ca9101e45e2a02ace2cb83513d/python/mypy/issues/3137 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5525fe53d261fdf6647abc31d3d6116064bf27ca9101e45e2a02ace2cb83513d/python/mypy/issues/3137 |
| og:image:alt | Assume this definition of Color: from enum import Enum class Color(Enum): red = 1 green = 2 blue = 3 Color['red'] works, and 'val : Color = Color['red']both work, butval = Color['red']` does not wo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jboning |
| 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