Title: [Enum] attributes of mixed-in classes can be shadowed by other members · Issue #103596 · python/cpython · GitHub
Open Graph Title: [Enum] attributes of mixed-in classes can be shadowed by other members · Issue #103596 · python/cpython
X Title: [Enum] attributes of mixed-in classes can be shadowed by other members · Issue #103596 · python/cpython
Description: As mentioned in #101273 , when mixing data types into an enum, the data type's methods can be lost: from enum import StrEnum, auto class Book(StrEnum): author = auto() title = auto() isbn = auto() Book.author #
Open Graph Description: As mentioned in #101273 , when mixing data types into an enum, the data type's methods can be lost: from enum import StrEnum, auto class Book(StrEnum): author = auto() title = auto() isbn = auto() ...
X Description: As mentioned in #101273 , when mixing data types into an enum, the data type's methods can be lost: from enum import StrEnum, auto class Book(StrEnum): author = auto() title = auto() isbn = aut...
Opengraph URL: https://github.com/python/cpython/issues/103596
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Enum] attributes of mixed-in classes can be shadowed by other members","articleBody":"As mentioned in #101273 , when mixing data types into an enum, the data type's methods can be lost:\r\n\r\n```python\r\nfrom enum import StrEnum, auto\r\n\r\nclass Book(StrEnum):\r\n author = auto()\r\n title = auto()\r\n isbn = auto()\r\n\r\nBook.author\r\n# \u003cBook.author: 'author'\u003e\r\n\r\nBook.author.title()\r\n# book object not callable exception, but 'Author' is expected\r\n```\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-103600\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/ethanfurman","@type":"Person","name":"ethanfurman"},"datePublished":"2023-04-17T21:38:45.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/103596/cpython/issues/103596"}
| 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:4037303b-3e4d-68ee-0444-bea7fa4dd14d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9156:339E6E:9A9C3C:CE3199:6969C1D4 |
| html-safe-nonce | e3d9cd91992b004f156f9616dcea17ca90db0ab3d1474942ba02fddf087b8e5c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTU2OjMzOUU2RTo5QTlDM0M6Q0UzMTk5OjY5NjlDMUQ0IiwidmlzaXRvcl9pZCI6IjcyNzA0NTkzNDY5NTkwNTczNjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | faab3274ecef8f41ec164b4191ecc425cf44526b6fbca0983262d41ca837eeca |
| hovercard-subject-tag | issue:1672008269 |
| 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/103596/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6f001df24ff1ca563395fc44bf0cb294aa86010bf7e85f7f24fa9e60846a0fc2/python/cpython/issues/103596 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6f001df24ff1ca563395fc44bf0cb294aa86010bf7e85f7f24fa9e60846a0fc2/python/cpython/issues/103596 |
| og:image:alt | As mentioned in #101273 , when mixing data types into an enum, the data type's methods can be lost: from enum import StrEnum, auto class Book(StrEnum): author = auto() title = auto() isbn = auto() ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ethanfurman |
| hostname | github.com |
| expected-hostname | github.com |
| None | acedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056 |
| 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 | 83c08c21cdda978090dc44364b71aa5bc6dcea79 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width