https://github.com/python/cpython/commit/7a3a78866a7460dda7c3fd0c20d929955d563a90 commit: 7a3a78866a7460dda7c3fd0c20d929955d563a90 branch: 3.14 author: Miss Islington (bot) <[email protected]> committer: serhiy-storchaka <[email protected]> date: 2026-06-11T15:16:00Z summary:
[3.14] gh-150285: Suppress showing the __getstate__() comment in the help for dataclasses (GH-151328) (GH-151332) (cherry picked from commit 0066fd73a20950dc790d219f4e3cfb07e816df47) Co-authored-by: Serhiy Storchaka <[email protected]> files: M Lib/dataclasses.py diff --git a/Lib/dataclasses.py b/Lib/dataclasses.py index f9c1113b1e367f..242a6d2ffc23b2 100644 --- a/Lib/dataclasses.py +++ b/Lib/dataclasses.py @@ -1247,6 +1247,7 @@ def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen, # classes with slots. These could be slightly more performant if we generated # the code instead of iterating over fields. But that can be a project for # another day, if performance becomes an issue. + def _dataclass_getstate(self): return [getattr(self, f.name) for f in fields(self)] _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
