Skip to content

Commit b6cb365

Browse files
[3.12] dataclasses docs: add some link anchors (GH-117601) (#117863)
dataclasses docs: add some link anchors (GH-117601) (cherry picked from commit c99d374) Co-authored-by: Jelle Zijlstra <[email protected]>
1 parent efeb8a2 commit b6cb365

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Doc/library/dataclasses.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,8 @@ See the section below on init-only variables for ways to pass
554554
parameters to :meth:`!__post_init__`. Also see the warning about how
555555
:func:`replace` handles ``init=False`` fields.
556556

557+
.. _dataclasses-class-variables:
558+
557559
Class variables
558560
---------------
559561

@@ -565,6 +567,8 @@ from consideration as a field and is ignored by the dataclass
565567
mechanisms. Such ``ClassVar`` pseudo-fields are not returned by the
566568
module-level :func:`fields` function.
567569

570+
.. _dataclasses-init-only-variables:
571+
568572
Init-only variables
569573
-------------------
570574

@@ -596,6 +600,8 @@ value is not provided when creating the class::
596600
In this case, :func:`fields` will return :class:`Field` objects for ``i`` and
597601
``j``, but not for ``database``.
598602

603+
.. _dataclasses-frozen:
604+
599605
Frozen instances
600606
----------------
601607

@@ -609,6 +615,8 @@ There is a tiny performance penalty when using ``frozen=True``:
609615
:meth:`~object.__init__` cannot use simple assignment to initialize fields, and
610616
must use :meth:`!__setattr__`.
611617

618+
.. _dataclasses-inheritance:
619+
612620
Inheritance
613621
-----------
614622

0 commit comments

Comments
 (0)