Title: bpo-34213: frozen dataclass with "object" attr bug by VadimPushtaev · Pull Request #8452 · python/cpython · GitHub
Open Graph Title: bpo-34213: frozen dataclass with "object" attr bug by VadimPushtaev · Pull Request #8452 · python/cpython
X Title: bpo-34213: frozen dataclass with "object" attr bug by VadimPushtaev · Pull Request #8452 · python/cpython
Description: For frozen dataclasses, attributes are set via object.__setattr__(name, value) in __init__. That won't work if object is a function argument which is entirely possible if object is an attribute name. The same problem is already resolved for self which is replaced by __dataclass_self__ if self is an attribute name. My solution is to store a reference to object in self and use self.__dataclass_object__ (or even __dataclass_self__.__dataclass_object__) if object doesn't work. https://bugs.python.org/issue34213
Open Graph Description: For frozen dataclasses, attributes are set via object.__setattr__(name, value) in __init__. That won't work if object is a function argument which is entirely possible if object is an attribute...
X Description: For frozen dataclasses, attributes are set via object.__setattr__(name, value) in __init__. That won't work if object is a function argument which is entirely possible if object is an attri...
Opengraph URL: https://github.com/python/cpython/pull/8452
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:4b9482f3-6f41-1cfa-8de5-0c58ded3eda7 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B9AC:DEF83:E4E73A:1371771:6A4F0419 |
| html-safe-nonce | 06e608ec43f6ef57781ad8fd5703347367d2b4bd1ebbb4e272ea9a004579d2fa |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOUFDOkRFRjgzOkU0RTczQToxMzcxNzcxOjZBNEYwNDE5IiwidmlzaXRvcl9pZCI6IjYzMjUxOTQ0NTU5NTIzMjc3MDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 68c1a005bc7c2ca51f74f3bd067031268c706963d1957f0d805b65dec1e771d3 |
| hovercard-subject-tag | pull_request:203660283 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/python/cpython/pull/8452/files |
| twitter:image | https://avatars.githubusercontent.com/u/1263643?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1263643?s=400&v=4 |
| og:image:alt | For frozen dataclasses, attributes are set via object.__setattr__(name, value) in __init__. That won't work if object is a function argument which is entirely possible if object is an attribute... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b8f23afb982271f1b22258a94aede67a6b77760 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width