From bbf73818ed4acaac2936d39e6eb59221284eca39 Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Wed, 19 Oct 2022 08:44:51 -0700 Subject: [PATCH 1/5] Change links to label refs --- Doc/howto/isolating-extensions.rst | 2 +- Doc/library/dataclasses.rst | 2 +- Doc/library/importlib.metadata.rst | 3 +-- Doc/reference/datamodel.rst | 2 ++ 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Doc/howto/isolating-extensions.rst b/Doc/howto/isolating-extensions.rst index 2657b4ec6aaf9f..2eddb582da7c24 100644 --- a/Doc/howto/isolating-extensions.rst +++ b/Doc/howto/isolating-extensions.rst @@ -461,7 +461,7 @@ Module State Access from Slot Methods, Getters and Setters .. After adding to limited API: - If you use the `limited API __, + If you use the :ref:`limited API , you must update ``Py_LIMITED_API`` to ``0x030b0000``, losing ABI compatibility with earlier versions. diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst index 4364ac342471eb..0321f7bbbda742 100644 --- a/Doc/library/dataclasses.rst +++ b/Doc/library/dataclasses.rst @@ -191,7 +191,7 @@ Module contents .. versionchanged:: 3.11 If a field name is already included in the ``__slots__`` of a base class, it will not be included in the generated ``__slots__`` - to prevent `overriding them `_. + to prevent :ref:`overriding them `. Therefore, do not use ``__slots__`` to retrieve the field names of a dataclass. Use :func:`fields` instead. To be able to determine inherited slots, diff --git a/Doc/library/importlib.metadata.rst b/Doc/library/importlib.metadata.rst index 4b94ccc49c47e7..988d1a317f5960 100644 --- a/Doc/library/importlib.metadata.rst +++ b/Doc/library/importlib.metadata.rst @@ -360,7 +360,7 @@ Because `Distribution Package `. To find a distribution package's metadata, ``importlib.metadata`` queries the list of :term:`meta path finders ` on :data:`sys.meta_path`. @@ -396,4 +396,3 @@ a custom finder, return instances of this derived ``Distribution`` in the .. _`entry point API`: https://setuptools.readthedocs.io/en/latest/pkg_resources.html#entry-points .. _`metadata API`: https://setuptools.readthedocs.io/en/latest/pkg_resources.html#metadata-api -.. _`finders`: https://docs.python.org/3/reference/import.html#finders-and-loaders diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 9dacd66ee564fd..a56b37c93379df 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1904,6 +1904,8 @@ Attribute lookup speed can be significantly improved as well. and *__weakref__* for each instance. +.. _note-slots: + Notes on using *__slots__* """""""""""""""""""""""""" From 7613ba71d0c1ebef40c68c86ec658ed999b21be4 Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Thu, 20 Oct 2022 09:10:12 -0700 Subject: [PATCH 2/5] Add missed label and ref --- Doc/howto/clinic.rst | 2 ++ Doc/whatsnew/3.8.rst | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Doc/howto/clinic.rst b/Doc/howto/clinic.rst index b8afc7e6d762aa..a97f1d23f53f31 100644 --- a/Doc/howto/clinic.rst +++ b/Doc/howto/clinic.rst @@ -1,5 +1,7 @@ .. highlight:: c +.. _howto-clinic: + ********************** Argument Clinic How-To ********************** diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 95aa6f7a8582ae..37a6cf24e54562 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -122,8 +122,8 @@ Positional-only parameters There is a new function parameter syntax ``/`` to indicate that some function parameters must be specified positionally and cannot be used as keyword arguments. This is the same notation shown by ``help()`` for C -functions annotated with Larry Hastings' `Argument Clinic -`_ tool. +functions annotated with Larry Hastings' +:ref:`Argument Clinic ` tool. In the following example, parameters *a* and *b* are positional-only, while *c* or *d* can be positional or keyword, and *e* or *f* are From 20fa1fbbb03a1258eb53f5f223201148ee76cab1 Mon Sep 17 00:00:00 2001 From: Stanley <46876382+slateny@users.noreply.github.com> Date: Thu, 20 Oct 2022 09:11:14 -0700 Subject: [PATCH 3/5] Use more specific label name Co-authored-by: C.A.M. Gerlach --- Doc/library/dataclasses.rst | 2 +- Doc/reference/datamodel.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst index 0321f7bbbda742..ab8df8b02c5f7f 100644 --- a/Doc/library/dataclasses.rst +++ b/Doc/library/dataclasses.rst @@ -191,7 +191,7 @@ Module contents .. versionchanged:: 3.11 If a field name is already included in the ``__slots__`` of a base class, it will not be included in the generated ``__slots__`` - to prevent :ref:`overriding them `. + to prevent :ref:`overriding them `. Therefore, do not use ``__slots__`` to retrieve the field names of a dataclass. Use :func:`fields` instead. To be able to determine inherited slots, diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index a56b37c93379df..301f41f3952c96 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1904,7 +1904,7 @@ Attribute lookup speed can be significantly improved as well. and *__weakref__* for each instance. -.. _note-slots: +.. _datamodel-note-slots: Notes on using *__slots__* """""""""""""""""""""""""" From 9fe6bfda041f47f718fee1d7a57c677db6d4b4ee Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Thu, 20 Oct 2022 18:31:43 -0700 Subject: [PATCH 4/5] Change some more links to labels --- Doc/using/venv-create.inc | 4 ++-- Doc/whatsnew/2.2.rst | 2 +- Doc/whatsnew/3.6.rst | 2 ++ Misc/NEWS.d/3.9.0a3.rst | 3 +-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Doc/using/venv-create.inc b/Doc/using/venv-create.inc index fd8cc019b4d1a8..c7a10151843e5f 100644 --- a/Doc/using/venv-create.inc +++ b/Doc/using/venv-create.inc @@ -16,8 +16,8 @@ re-used. .. deprecated:: 3.6 ``pyvenv`` was the recommended tool for creating virtual environments for - Python 3.3 and 3.4, and is `deprecated in Python 3.6 - `_. + Python 3.3 and 3.4, and is + :ref:`deprecated in Python 3.6 `. .. versionchanged:: 3.5 The use of ``venv`` is now recommended for creating virtual environments. diff --git a/Doc/whatsnew/2.2.rst b/Doc/whatsnew/2.2.rst index 39997661bb96c4..0c3bfda1933957 100644 --- a/Doc/whatsnew/2.2.rst +++ b/Doc/whatsnew/2.2.rst @@ -395,7 +395,7 @@ This section has just been a quick overview of the new features, giving enough of an explanation to start you programming, but many details have been simplified or ignored. Where should you go to get a more complete picture? -https://docs.python.org/dev/howto/descriptor.html is a lengthy tutorial introduction to +The :ref:`descriptorhowto` is a lengthy tutorial introduction to the descriptor features, written by Guido van Rossum. If my description has whetted your appetite, go read this tutorial next, because it goes into much more detail about the new features while still remaining quite easy to read. diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst index 9308d1a76fec7a..3e1f4ee564e238 100644 --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -2052,6 +2052,8 @@ tkinter The :mod:`tkinter.tix` module is now deprecated. :mod:`tkinter` users should use :mod:`tkinter.ttk` instead. +.. _whatsnew-3.6-venv: + venv ~~~~ diff --git a/Misc/NEWS.d/3.9.0a3.rst b/Misc/NEWS.d/3.9.0a3.rst index 77ccc7453c2157..d3220d99542f67 100644 --- a/Misc/NEWS.d/3.9.0a3.rst +++ b/Misc/NEWS.d/3.9.0a3.rst @@ -805,8 +805,7 @@ event loop only if called from the main thread. .. section: Documentation Add an entry for ``__module__`` in the "function" & "method" sections of the -`inspect docs types and members table -`_ +:ref:`inspect docs types and members table `. .. From 6abd61c678c9ba896f902fe34d6fdefc1497e0b3 Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Thu, 20 Oct 2022 20:57:30 -0700 Subject: [PATCH 5/5] Follow convention for label naming, add link to inspect module --- Doc/using/venv-create.inc | 2 +- Doc/whatsnew/3.6.rst | 2 +- Misc/NEWS.d/3.9.0a3.rst | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/using/venv-create.inc b/Doc/using/venv-create.inc index c7a10151843e5f..d535b254f05698 100644 --- a/Doc/using/venv-create.inc +++ b/Doc/using/venv-create.inc @@ -17,7 +17,7 @@ re-used. .. deprecated:: 3.6 ``pyvenv`` was the recommended tool for creating virtual environments for Python 3.3 and 3.4, and is - :ref:`deprecated in Python 3.6 `. + :ref:`deprecated in Python 3.6 `. .. versionchanged:: 3.5 The use of ``venv`` is now recommended for creating virtual environments. diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst index 3e1f4ee564e238..e4294c88b58572 100644 --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -2052,7 +2052,7 @@ tkinter The :mod:`tkinter.tix` module is now deprecated. :mod:`tkinter` users should use :mod:`tkinter.ttk` instead. -.. _whatsnew-3.6-venv: +.. _whatsnew36-venv: venv ~~~~ diff --git a/Misc/NEWS.d/3.9.0a3.rst b/Misc/NEWS.d/3.9.0a3.rst index d3220d99542f67..54b61ca3b7785f 100644 --- a/Misc/NEWS.d/3.9.0a3.rst +++ b/Misc/NEWS.d/3.9.0a3.rst @@ -805,7 +805,7 @@ event loop only if called from the main thread. .. section: Documentation Add an entry for ``__module__`` in the "function" & "method" sections of the -:ref:`inspect docs types and members table `. +:mod:`inspect` docs' :ref:`inspect-types` table. ..