https://github.com/python/cpython/commit/c99d374fc7327ebd47e22c3b1906bc865aad80a1
commit: c99d374fc7327ebd47e22c3b1906bc865aad80a1
branch: main
author: Jelle Zijlstra <[email protected]>
committer: hauntsaninja <[email protected]>
date: 2024-04-14T01:03:16-07:00
summary:

dataclasses docs: add some link anchors (#117601)

files:
M Doc/library/dataclasses.rst

diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst
index fe56345f3a7fd2..70aaaa526be554 100644
--- a/Doc/library/dataclasses.rst
+++ b/Doc/library/dataclasses.rst
@@ -556,6 +556,8 @@ See the section below on init-only variables for ways to 
pass
 parameters to :meth:`!__post_init__`.  Also see the warning about how
 :func:`replace` handles ``init=False`` fields.
 
+.. _dataclasses-class-variables:
+
 Class variables
 ---------------
 
@@ -567,6 +569,8 @@ from consideration as a field and is ignored by the 
dataclass
 mechanisms.  Such ``ClassVar`` pseudo-fields are not returned by the
 module-level :func:`fields` function.
 
+.. _dataclasses-init-only-variables:
+
 Init-only variables
 -------------------
 
@@ -598,6 +602,8 @@ value is not provided when creating the class::
 In this case, :func:`fields` will return :class:`Field` objects for ``i`` and
 ``j``, but not for ``database``.
 
+.. _dataclasses-frozen:
+
 Frozen instances
 ----------------
 
@@ -611,6 +617,8 @@ There is a tiny performance penalty when using 
``frozen=True``:
 :meth:`~object.__init__` cannot use simple assignment to initialize fields, and
 must use :meth:`!__setattr__`.
 
+.. _dataclasses-inheritance:
+
 Inheritance
 -----------
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to