Title: Change in Flag enum behaviour in v3.11rc2 · Issue #96865 · python/cpython · GitHub
Open Graph Title: Change in Flag enum behaviour in v3.11rc2 · Issue #96865 · python/cpython
X Title: Change in Flag enum behaviour in v3.11rc2 · Issue #96865 · python/cpython
Description: Bug report The default behaviour of Flag enums has chenged between Python v3.10 and v3.11 Your environment Python v3.11rc2 on macOS The following script... from enum import Flag class MethodHint(Flag): HiddenText = 0x10 DigitsOnly = 0x01...
Open Graph Description: Bug report The default behaviour of Flag enums has chenged between Python v3.10 and v3.11 Your environment Python v3.11rc2 on macOS The following script... from enum import Flag class MethodHint(Fl...
X Description: Bug report The default behaviour of Flag enums has chenged between Python v3.10 and v3.11 Your environment Python v3.11rc2 on macOS The following script... from enum import Flag class MethodHint(Fl...
Opengraph URL: https://github.com/python/cpython/issues/96865
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Change in Flag enum behaviour in v3.11rc2","articleBody":"# Bug report\r\n\r\nThe default behaviour of Flag enums has chenged between Python v3.10 and v3.11\r\n\r\n# Your environment\r\n\r\nPython v3.11rc2 on macOS\r\n\r\nThe following script...\r\n\r\n```\r\nfrom enum import Flag\r\n\r\nclass MethodHint(Flag):\r\n HiddenText = 0x10\r\n DigitsOnly = 0x01\r\n LettersOnly = 0x02\r\n OnlyMask = 0x0f\r\n\r\nprint(MethodHint.HiddenText|MethodHint.OnlyMask)\r\n```\r\n\r\n...raises a ValueError in v3.11 and prints...\r\n\r\nMethodHint.HiddenText|OnlyMask|LettersOnly|DigitsOnly\r\n\r\nin v3.10.\r\n\r\nWhile it's not particularly sensible to bitwise-or a mask it is a significant change of behaviour without a deprecation period.\r\n\r\nIt will be common to have a mask value that covers more bits than currently defined when allowing for future expansion of the flags.","author":{"url":"https://github.com/philthompson10","@type":"Person","name":"philthompson10"},"datePublished":"2022-09-16T13:45:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/96865/cpython/issues/96865"}
| 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:06d0f1ee-de7c-7c3f-f519-f5863aefaa21 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ACC8:1D70BE:A1D0DF:D825FE:69699171 |
| html-safe-nonce | f3f228dc884a5b001590e7b15c07840ab4c9c266c4719ea3b6d44487dd3884d8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQ0M4OjFENzBCRTpBMUQwREY6RDgyNUZFOjY5Njk5MTcxIiwidmlzaXRvcl9pZCI6IjgxNDM5Mjc0OTg3ODE1OTM5NjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 94abb9442b9279bc3cd4b7053878238d474fc757412514d37263805de1eeea4d |
| hovercard-subject-tag | issue:1375975121 |
| 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/96865/issue_layout |
| twitter:image | https://opengraph.githubassets.com/162efd04eac17d726765214f2a1d372c58970058d40870995d13caa15570a403/python/cpython/issues/96865 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/162efd04eac17d726765214f2a1d372c58970058d40870995d13caa15570a403/python/cpython/issues/96865 |
| og:image:alt | Bug report The default behaviour of Flag enums has chenged between Python v3.10 and v3.11 Your environment Python v3.11rc2 on macOS The following script... from enum import Flag class MethodHint(Fl... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | philthompson10 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3542e147982176a7ebaa23dfb559c8af16f721c03ec560c68c56b64a0f35e751 |
| 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 | af80af7cc9e3de9c336f18b208a600950a3c187c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width