Skip to content

Commit c99d374

Browse files
dataclasses docs: add some link anchors (#117601)
1 parent 0dcfd0d commit c99d374

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
@@ -556,6 +556,8 @@ See the section below on init-only variables for ways to pass
556556
parameters to :meth:`!__post_init__`. Also see the warning about how
557557
:func:`replace` handles ``init=False`` fields.
558558

559+
.. _dataclasses-class-variables:
560+
559561
Class variables
560562
---------------
561563

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

572+
.. _dataclasses-init-only-variables:
573+
570574
Init-only variables
571575
-------------------
572576

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

605+
.. _dataclasses-frozen:
606+
601607
Frozen instances
602608
----------------
603609

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

620+
.. _dataclasses-inheritance:
621+
614622
Inheritance
615623
-----------
616624

0 commit comments

Comments
 (0)