Title: It seems that `enum.Enum.__init__` serves no purpose · Issue #128080 · python/cpython · GitHub
Open Graph Title: It seems that `enum.Enum.__init__` serves no purpose · Issue #128080 · python/cpython
X Title: It seems that `enum.Enum.__init__` serves no purpose · Issue #128080 · python/cpython
Description: Feature or enhancement Proposal: Enum gained an __init__ method in 3.11 which just passes: def __init__(self, *args, **kwds): pass That was added in #30582. One person questioned it at the time, but there was no response. The best I can ...
Open Graph Description: Feature or enhancement Proposal: Enum gained an __init__ method in 3.11 which just passes: def __init__(self, *args, **kwds): pass That was added in #30582. One person questioned it at the time, bu...
X Description: Feature or enhancement Proposal: Enum gained an __init__ method in 3.11 which just passes: def __init__(self, *args, **kwds): pass That was added in #30582. One person questioned it at the time, bu...
Opengraph URL: https://github.com/python/cpython/issues/128080
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"It seems that `enum.Enum.__init__` serves no purpose","articleBody":"# Feature or enhancement\r\n\r\n### Proposal:\r\n\r\nEnum gained an `__init__` method in 3.11 which just passes:\r\n\r\n```python\r\n def __init__(self, *args, **kwds):\r\n pass\r\n```\r\n\r\nThat was added in https://github.com/python/cpython/pull/30582. [One person questioned it at the time](https://github.com/python/cpython/pull/30582#issuecomment-1181055042), but there was no response. The best I can figure is that it was related to special handling of `__init__` in `EnumType.__dir__`, which you can see here: https://github.com/python/cpython/blob/3852269b91fcc8ee668cd876b3669eba6da5b1ac/Lib/enum.py#L768-L779\r\n\r\nThat special handling of `__init__` was removed by https://github.com/python/cpython/pull/30677 prior to 3.11 being released, which leaves no plausible function to `Enum.__init__` that I can see. It muddies introspection of the type, so I think we should remove it if that's really the case.\r\n\r\n\r\n### Has this already been discussed elsewhere?\r\n\r\nThis is a minor feature, which does not need previous discussion elsewhere\r\n\r\n### Links to previous discussion of this feature:\r\n\r\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-128081\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/tungol","@type":"Person","name":"tungol"},"datePublished":"2024-12-18T21:05:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/128080/cpython/issues/128080"}
| 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:f2e12822-d617-2acd-c9d0-90d66fbacb38 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9ACA:2DA0A8:3C6A2F:51B9EA:6969AD5F |
| html-safe-nonce | dd729f4c50b4641d94f7d933e68d25a0c7048ce648d1163c9f551a5f317a09c7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QUNBOjJEQTBBODozQzZBMkY6NTFCOUVBOjY5NjlBRDVGIiwidmlzaXRvcl9pZCI6IjM1MTQ3MzM1OTU5Mjc4ODMxMDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | bd626cb819d185ba41f9f7d368f7b1e5cfb139935eb27358f2796a6a942c1340 |
| hovercard-subject-tag | issue:2748749528 |
| 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/cpython/128080/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b5a040045bc0ec1e4f4666195267dc70e350eabe4e06510f18d8eaa55e4c17ac/python/cpython/issues/128080 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b5a040045bc0ec1e4f4666195267dc70e350eabe4e06510f18d8eaa55e4c17ac/python/cpython/issues/128080 |
| og:image:alt | Feature or enhancement Proposal: Enum gained an __init__ method in 3.11 which just passes: def __init__(self, *args, **kwds): pass That was added in #30582. One person questioned it at the time, bu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tungol |
| hostname | github.com |
| expected-hostname | github.com |
| None | 24c4c97a2d520cb286b35e1a4c22d7a4df3c26a2fa28dd7cdf0e65db327b4de7 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| 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 | 124667f43168afb6c9c03b7c02eb5b1d2e1be3d9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width