Title: Support functional API for Enum creation · Issue #2306 · python/mypy · GitHub
Open Graph Title: Support functional API for Enum creation · Issue #2306 · python/mypy
X Title: Support functional API for Enum creation · Issue #2306 · python/mypy
Description: The enum.Enum class (new in Python 3.4, also backported as enum34) supports several short forms of creating an Enum type, described under functional API: A = Enum('A', 'x y z') B = Enum('B', ('p', 'q')) These are equivalent to class A(En...
Open Graph Description: The enum.Enum class (new in Python 3.4, also backported as enum34) supports several short forms of creating an Enum type, described under functional API: A = Enum('A', 'x y z') B = Enum('B', ('p', ...
X Description: The enum.Enum class (new in Python 3.4, also backported as enum34) supports several short forms of creating an Enum type, described under functional API: A = Enum('A', 'x y z') B = ...
Opengraph URL: https://github.com/python/mypy/issues/2306
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support functional API for Enum creation","articleBody":"The `enum.Enum` class (new in Python 3.4, also backported as enum34) supports several short forms of creating an Enum type, described under [functional API](https://docs.python.org/3/library/enum.html#functional-api):\n\n``` python\nA = Enum('A', 'x y z')\nB = Enum('B', ('p', 'q'))\n```\n\nThese are equivalent to\n\n``` python\nclass A(Enum):\n x = 1\n y = 2\n z = 3\nclass B(Enum):\n p = 1\n q = 2\n```\n\nSome other syntactic variants are also allowed:\n\n``` python\nA = Enum('A', 'x,y,z')\nA = Enum('A', 'x, y, z')\nB = Enum('B', ['p', 'q'])\n```\n\nThe values can also be expressed as a list of tuples:\n\n``` python\n[('cyan', 4), ('magenta', 5), ('yellow', 6)]\n```\n\nor a mapping:\n\n``` python\n{'chartreuse': 7, 'sea_green': 11, 'rosemary': 42}\n```\n","author":{"url":"https://github.com/gvanrossum","@type":"Person","name":"gvanrossum"},"datePublished":"2016-10-24T17:04:05Z","url":"https://github.com/python/mypy/issues/2306"}
| 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:4450f687-6cc3-6f5f-c6ff-d6235841945a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8F7C:BACA4:2830162:34CB206:6B000A76 |
| html-safe-nonce | 6f31d390d852828371b246f7569d1debfd80a0b23bd4c4d96e54ade436fd9c17 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RjdDOkJBQ0E0OjI4MzAxNjI6MzRDQjIwNjo2QjAwMEE3NiIsInZpc2l0b3JfaWQiOiIyOTczNjgzNTAzNjU4NDYxMzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 43725133c4ff95d8480077dba1a6ebca4b29ce895a2def0542e463ea60daf447 |
| hovercard-subject-tag | issue:184898794 |
| 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/2306/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ba559e913a8de6eec553b0c0feb37b35e13dff81a17317d5d79db0d053351d05/python/mypy/issues/2306 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ba559e913a8de6eec553b0c0feb37b35e13dff81a17317d5d79db0d053351d05/python/mypy/issues/2306 |
| og:image:alt | The enum.Enum class (new in Python 3.4, also backported as enum34) supports several short forms of creating an Enum type, described under functional API: A = Enum('A', 'x y z') B = Enum('B', ('p', ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gvanrossum |
| 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