From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 11 Jun 2026 15:01:11 +0000 (+0200) Subject: [3.15] gh-150285: Suppress showing the __getstate__() comment in the help for datacla... X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=dc7ca40343e13c92afa2fff8bfe5a85914a20474;p=thirdparty%2FPython%2Fcpython.git [3.15] gh-150285: Suppress showing the __getstate__() comment in the help for dataclasses (GH-151328) (GH-151331) (cherry picked from commit 0066fd73a20950dc790d219f4e3cfb07e816df47) Co-authored-by: Serhiy Storchaka --- diff --git a/Lib/dataclasses.py b/Lib/dataclasses.py index dbfabded2e47..863e4101f98b 100644 --- a/Lib/dataclasses.py +++ b/Lib/dataclasses.py @@ -1250,6 +1250,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)]