Title: gh-98886: Fix issues with dataclass fields with special underscore names by hauntsaninja · Pull Request #102032 · python/cpython · GitHub
Open Graph Title: gh-98886: Fix issues with dataclass fields with special underscore names by hauntsaninja · Pull Request #102032 · python/cpython
X Title: gh-98886: Fix issues with dataclass fields with special underscore names by hauntsaninja · Pull Request #102032 · python/cpython
Description: This commit prefixes __dataclass to several things in the locals dict: Names like _dflt_ (which cause trouble, see first test) Names like _type_ (not known to be able to cause trouble) _return_type (not known to able to cause trouble) _HAS_DEFAULT_FACTORY (which causes trouble, see second test) In addition, this removes MISSING from the locals dict. As far as I can tell, this wasn't needed even in the initial implementation of dataclasses.py (and tests on that version passed with it removed). This makes me wary :-) This is basically a continuation of #96151, where fixing this was welcomed in #98143 (comment) Issue: gh-98886
Open Graph Description: This commit prefixes __dataclass to several things in the locals dict: Names like _dflt_ (which cause trouble, see first test) Names like _type_ (not known to be able to cause trouble) _return_typ...
X Description: This commit prefixes __dataclass to several things in the locals dict: Names like _dflt_ (which cause trouble, see first test) Names like _type_ (not known to be able to cause trouble) _return_typ...
Opengraph URL: https://github.com/python/cpython/pull/102032
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:e3f27fe6-6649-2716-5512-8cc7c1eda63d |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 81B2:3463DE:25A518C:33FA132:6A4F4CDC |
| html-safe-nonce | c31570caefa4bfcb97fa88d9920bde7b73de859fb54ef2c2f327104259e2f010 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MUIyOjM0NjNERToyNUE1MThDOjMzRkExMzI6NkE0RjRDREMiLCJ2aXNpdG9yX2lkIjoiODk1MjY3Mjg1ODg2NzgyNjg0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 00b75ab29edc50f348febe41c569b6cfc9ae14abeb460dcfc8ea2ed9e8e9c1fe |
| hovercard-subject-tag | pull_request:1246148301 |
| 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/102032/files |
| twitter:image | https://avatars.githubusercontent.com/u/12621235?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/12621235?s=400&v=4 |
| og:image:alt | This commit prefixes __dataclass to several things in the locals dict: Names like _dflt_ (which cause trouble, see first test) Names like _type_ (not known to be able to cause trouble) _return_typ... |
| 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 | 4b249b445842943ed31549e027f57a8ade9881ed |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width