]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-137900: Improve dataclasses frozen parameter documentation (#137937)
authorTangyuan <47830915@qq.com>
Wed, 20 Aug 2025 13:08:45 +0000 (21:08 +0800)
committerGitHub <noreply@github.com>
Wed, 20 Aug 2025 13:08:45 +0000 (09:08 -0400)
Doc/library/dataclasses.rst

index 299c8aa399c25c048e4c474b82b70084a9a10c5f..2e4520c823bf3ee0270af6d0b1a3a0b2adf2a3f9 100644 (file)
@@ -161,9 +161,11 @@ Module contents
      :class:`object`, this means it will fall back to id-based hashing).
 
    - *frozen*: If true (the default is ``False``), assigning to fields will
-     generate an exception.  This emulates read-only frozen instances.  If
-     :meth:`~object.__setattr__` or :meth:`~object.__delattr__` is defined in the class, then
-     :exc:`TypeError` is raised.  See the discussion below.
+     generate an exception.  This emulates read-only frozen instances.
+     See the :ref:`discussion <dataclasses-frozen>` below.
+
+     If :meth:`~object.__setattr__` or :meth:`~object.__delattr__` is defined in the class
+     and *frozen* is true, then :exc:`TypeError` is raised.
 
    - *match_args*: If true (the default is ``True``), the
      :attr:`~object.__match_args__` tuple will be created from the list of