Title: Misc questions, suggestions, and error corrections for dataclasses by rhettinger · Pull Request #4726 · python/cpython · GitHub
Open Graph Title: Misc questions, suggestions, and error corrections for dataclasses by rhettinger · Pull Request #4726 · python/cpython
X Title: Misc questions, suggestions, and error corrections for dataclasses by rhettinger · Pull Request #4726 · python/cpython
Description: These are for Eric's consideration: Fix typo leading to a SyntaxError in the make_dataclass docstring Let make_dataclass pass through keyword arguments (ordered, hash, frozen, etc) Replace "len(s)==0" with the faster and more idiomatic (PEP 8ish) "not s" Ask whether asdict() should return an OrderedDict instead of a regular dict Even though the class implementation details have "hash=None" as a way of turning off hashing, the dataclass API should use regular booleans and have the default be "hash=False" (as equivalent to "hash=None"). It is a bit of an API landmine to have hashing succeed in this example: >>> from dataclasses import dataclass >>> @dataclass(hash=False) ... class C: ... x: int ... >>> hash(C(999)) -9223372036585142703
Open Graph Description: These are for Eric's consideration: Fix typo leading to a SyntaxError in the make_dataclass docstring Let make_dataclass pass through keyword arguments (ordered, hash, frozen, etc) Replace &qu...
X Description: These are for Eric's consideration: Fix typo leading to a SyntaxError in the make_dataclass docstring Let make_dataclass pass through keyword arguments (ordered, hash, frozen, etc) Replace...
Opengraph URL: https://github.com/python/cpython/pull/4726
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:c56348a5-cfde-4797-6105-2950ce82f783 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | AF9E:2D7630:12BC580:19F76CF:6A4EA11D |
| html-safe-nonce | 0810f1a3b78a3021c4b0a71ce5ec6f434e5a60f26b0ffae0ed921c575633bdca |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjlFOjJENzYzMDoxMkJDNTgwOjE5Rjc2Q0Y6NkE0RUExMUQiLCJ2aXNpdG9yX2lkIjoiMzMzMjEyODI4NTM0OTgxNDU1NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 404c297ebd636c8ec0cfb9da52fee54d1bae6b2721faedb9ffbdd31219730790 |
| hovercard-subject-tag | pull_request:156380375 |
| 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/4726/files |
| twitter:image | https://avatars.githubusercontent.com/u/1623689?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1623689?s=400&v=4 |
| og:image:alt | These are for Eric's consideration: Fix typo leading to a SyntaxError in the make_dataclass docstring Let make_dataclass pass through keyword arguments (ordered, hash, frozen, etc) Replace &qu... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| 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 | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width