From c99b5a48191198e5b364f6f643ef647396be4864 Mon Sep 17 00:00:00 2001 From: Jakub Kuczys Date: Tue, 14 Oct 2025 01:42:08 +0200 Subject: [PATCH 1/4] Link to slice's data model docs in its Built-in Functions entry --- Doc/builtins/functions.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Doc/builtins/functions.rst b/Doc/builtins/functions.rst index f6203b026d32a4..b9adb36d9811fa 100644 --- a/Doc/builtins/functions.rst +++ b/Doc/builtins/functions.rst @@ -2014,6 +2014,8 @@ are always available. They are listed here in alphabetical order. (or their default). They have no other explicit functionality; however, they are used by NumPy and other third-party packages. + See also :ref:`slice-objects`. + .. versionchanged:: 3.12 Slice objects are now :term:`hashable` (provided :attr:`~slice.start`, :attr:`~slice.stop`, and :attr:`~slice.step` are hashable). From f87cdaafb9ddd21092ced53128e31e3196c8c3f1 Mon Sep 17 00:00:00 2001 From: Jakub Kuczys Date: Tue, 14 Oct 2025 01:43:36 +0200 Subject: [PATCH 2/4] Link to slice's data model docs in its glossary entry --- Doc/glossary.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Doc/glossary.rst b/Doc/glossary.rst index 68bc0560911161..fe9cfa00839b3a 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -1481,6 +1481,8 @@ Glossary of :ref:`subscript notation `, with colons inside square brackets, such as in ``variable_name[1:3:5]``. + See also :ref:`slice-objects`. + soft deprecated A soft deprecated API should not be used in new code, but it is safe for already existing code to use it. From 76b2e32bdbaa01ae54a6825f654ecda7170ff7f9 Mon Sep 17 00:00:00 2001 From: Jakub Kuczys Date: Tue, 14 Oct 2025 01:48:57 +0200 Subject: [PATCH 3/4] Make "slice objects" a link in Built-in Types --- Doc/builtins/stdtypes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/builtins/stdtypes.rst b/Doc/builtins/stdtypes.rst index cf05f947c5908d..75694c2db660a3 100644 --- a/Doc/builtins/stdtypes.rst +++ b/Doc/builtins/stdtypes.rst @@ -6775,7 +6775,7 @@ Internal Objects See :ref:`types` for this information. It describes :ref:`stack frame objects `, -:ref:`traceback objects `, and slice objects. +:ref:`traceback objects `, and :ref:`slice objects `. .. _specialattrs: From 99a3f7e85ca860d664f304d15c72ed9386022ca0 Mon Sep 17 00:00:00 2001 From: Jakub Kuczys Date: Fri, 16 Oct 2026 18:03:29 +0200 Subject: [PATCH 4/4] Fix anchor names --- Doc/c-api/slice.rst | 2 +- Doc/reference/datamodel.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/c-api/slice.rst b/Doc/c-api/slice.rst index ce2b64a8aca853..f7fdf2c38846af 100644 --- a/Doc/c-api/slice.rst +++ b/Doc/c-api/slice.rst @@ -1,6 +1,6 @@ .. highlight:: c -.. _slice-objects: +.. _c-api-slice-objects: Slice Objects ------------- diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index c860a3356628af..47fa807a7990ae 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1878,6 +1878,7 @@ occurred in a .. versionchanged:: 3.7 This attribute is now writable +.. _slice-objects: Slice objects ^^^^^^^^^^^^^