Skip to content

Commit 7685b8a

Browse files
authored
gh-137900: Improve dataclasses frozen parameter documentation (#137937)
1 parent 23adbf5 commit 7685b8a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Doc/library/dataclasses.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,11 @@ Module contents
161161
:class:`object`, this means it will fall back to id-based hashing).
162162

163163
- *frozen*: If true (the default is ``False``), assigning to fields will
164-
generate an exception. This emulates read-only frozen instances. If
165-
:meth:`~object.__setattr__` or :meth:`~object.__delattr__` is defined in the class, then
166-
:exc:`TypeError` is raised. See the discussion below.
164+
generate an exception. This emulates read-only frozen instances.
165+
See the :ref:`discussion <dataclasses-frozen>` below.
166+
167+
If :meth:`~object.__setattr__` or :meth:`~object.__delattr__` is defined in the class
168+
and *frozen* is true, then :exc:`TypeError` is raised.
167169

168170
- *match_args*: If true (the default is ``True``), the
169171
:attr:`~object.__match_args__` tuple will be created from the list of

0 commit comments

Comments
 (0)