Title: Enum values on enum class can't be reassigned or deleted · Issue #7385 · python/typeshed · GitHub
Open Graph Title: Enum values on enum class can't be reassigned or deleted · Issue #7385 · python/typeshed
X Title: Enum values on enum class can't be reassigned or deleted · Issue #7385 · python/typeshed
Description: The EnumMeta class in enum.pyi was recently modified to include a __setattr__ and __delattr__ method. These were flagged as a bug in pyright's unit tests because an attempt to set or delete an attribute on an enum class results in a runt...
Open Graph Description: The EnumMeta class in enum.pyi was recently modified to include a __setattr__ and __delattr__ method. These were flagged as a bug in pyright's unit tests because an attempt to set or delete an attr...
X Description: The EnumMeta class in enum.pyi was recently modified to include a __setattr__ and __delattr__ method. These were flagged as a bug in pyright's unit tests because an attempt to set or delete an ...
Opengraph URL: https://github.com/python/typeshed/issues/7385
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Enum values on enum class can't be reassigned or deleted","articleBody":"The `EnumMeta` class in `enum.pyi` was recently modified to include a `__setattr__` and `__delattr__` method. These were flagged as a bug in pyright's unit tests because an attempt to set or delete an attribute on an enum class results in a runtime error.\r\n\r\n```python\r\nfrom enum import Enum\r\n\r\nclass Color(Enum):\r\n red = \"red\"\r\n\r\n# This should generate an error because reassignment of enum\r\n# values is not allowed.\r\n# Note: A change to typeshed's enum.pyi breaks this test.\r\nColor.red = \"new\" # Runtime exception\r\n```\r\n\r\nThe above code is no longer flagged as an error by pyright although it generates a runtime exception.\r\n\r\n@AlexWaygood, I think you submitted the PR for this change. Was the addition of `__setattr__` and `__delattr__` intentional?","author":{"url":"https://github.com/erictraut","@type":"Person","name":"erictraut"},"datePublished":"2022-02-25T22:52:49Z","url":"https://github.com/python/typeshed/issues/7385"}
| 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:b4ed9236-fa79-66b4-530e-20fe4f5e18d7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B168:24D752:1F6268:2A4998:6B0021DE |
| html-safe-nonce | afa4ac1dff34a522e2a9c6a0adddf86ade8983ae2926c79ce163574d1f3b4e59 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTY4OjI0RDc1MjoxRjYyNjg6MkE0OTk4OjZCMDAyMURFIiwidmlzaXRvcl9pZCI6IjYwMTk3Njg2MTEzMDcwMDQzODIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b4fc3bfe5fd9f653398e773e1dfa2f728472c0ad0d2f2dc15bc9e6708ec7ee8d |
| hovercard-subject-tag | issue:1150945646 |
| 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/typeshed/7385/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3718e0105aea621327eb2c9f1a336a20a3d79edf262dc39436387296da2c74d5/python/typeshed/issues/7385 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3718e0105aea621327eb2c9f1a336a20a3d79edf262dc39436387296da2c74d5/python/typeshed/issues/7385 |
| og:image:alt | The EnumMeta class in enum.pyi was recently modified to include a __setattr__ and __delattr__ method. These were flagged as a bug in pyright's unit tests because an attempt to set or delete an attr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | erictraut |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typeshed git https://github.com/python/typeshed.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 31696383 |
| octolytics-dimension-repository_nwo | python/typeshed |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31696383 |
| octolytics-dimension-repository_network_root_nwo | python/typeshed |
| 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 | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width