Title: Python 3.11.0b4 str(enum) giving integer value and not name · Issue #94763 · python/cpython · GitHub
Open Graph Title: Python 3.11.0b4 str(enum) giving integer value and not name · Issue #94763 · python/cpython
X Title: Python 3.11.0b4 str(enum) giving integer value and not name · Issue #94763 · python/cpython
Description: Bug report The str() method on Python 3.11.0b4 is outputting the raw integer value not the class name and label that older Python versions do. import enum class MyEnum(enum.IntEnum): TEST = 1 assert str(MyEnum.TEST) == "MyEnum.TEST", f"A...
Open Graph Description: Bug report The str() method on Python 3.11.0b4 is outputting the raw integer value not the class name and label that older Python versions do. import enum class MyEnum(enum.IntEnum): TEST = 1 asser...
X Description: Bug report The str() method on Python 3.11.0b4 is outputting the raw integer value not the class name and label that older Python versions do. import enum class MyEnum(enum.IntEnum): TEST = 1 asser...
Opengraph URL: https://github.com/python/cpython/issues/94763
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Python 3.11.0b4 str(enum) giving integer value and not name","articleBody":"**Bug report**\r\n\r\nThe `str()` method on Python 3.11.0b4 is outputting the raw integer value not the class name and label that older Python versions do.\r\n\r\n```python\r\nimport enum\r\n\r\nclass MyEnum(enum.IntEnum):\r\n TEST = 1\r\n\r\n\r\nassert str(MyEnum.TEST) == \"MyEnum.TEST\", f\"Actual '{MyEnum.TEST}'\"\r\n```\r\n\r\nOn Python 3.10 (and older Python 3 versions) this assertion is true. On python 3.11.0b4 the str value is just `1`.\r\n\r\nThe `repr()` is the same as on older versions, just seems like `str()` is affected.\r\n\r\n**Your environment**\r\n\r\n- CPython versions tested on: 3.11.0b4\r\n- Operating system and architecture: Linux (should be N/A though)","author":{"url":"https://github.com/jborean93","@type":"Person","name":"jborean93"},"datePublished":"2022-07-11T22:49:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/94763/cpython/issues/94763"}
| 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:8c9dbf86-d5de-050f-be43-1376881776eb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AFDC:2F21B4:A49212:D527FB:696B228F |
| html-safe-nonce | 5bff729ceecd3b7033bad970039e85a387441eed2dbce9e10a4c949baca4991c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkRDOjJGMjFCNDpBNDkyMTI6RDUyN0ZCOjY5NkIyMjhGIiwidmlzaXRvcl9pZCI6IjYxODYyMzE4NTg1MjIxNjk5OTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | fa8ca767b3a2ee076dafd0ae52aedd8cd576baf49265cac6deecd340dd4d2a39 |
| hovercard-subject-tag | issue:1301322192 |
| 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/94763/issue_layout |
| twitter:image | https://opengraph.githubassets.com/633a432f6f77afc09be61ebb0f0428d28c85534a22ec5417d2b85fa58d25b840/python/cpython/issues/94763 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/633a432f6f77afc09be61ebb0f0428d28c85534a22ec5417d2b85fa58d25b840/python/cpython/issues/94763 |
| og:image:alt | Bug report The str() method on Python 3.11.0b4 is outputting the raw integer value not the class name and label that older Python versions do. import enum class MyEnum(enum.IntEnum): TEST = 1 asser... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jborean93 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| 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 | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width