summaryrefslogtreecommitdiffstats
path: root/Doc/howto
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-07-23 10:00:31 (GMT)
committerGitHub <noreply@github.com>2023-07-23 10:00:31 (GMT)
commit332db37835c403a0939aa46527736a9ea898c819 (patch)
tree9f6779725150e0bcfd244e33366f1676004071d6 /Doc/howto
parenta73d5c5e2e0529642adc896f9ae4d3987ec5374a (diff)
downloadcpython-332db37835c403a0939aa46527736a9ea898c819.zip
cpython-332db37835c403a0939aa46527736a9ea898c819.tar.gz
cpython-332db37835c403a0939aa46527736a9ea898c819.tar.bz2
[3.12] gh-101100: Fix some broken sphinx references (GH-107095) (#107103)
(cherry picked from commit f5147c0cfbd7943ff10917225448c36a53f9828d) Co-authored-by: wulmer <wulmer@users.noreply.github.com>
Diffstat (limited to 'Doc/howto')
-rw-r--r--Doc/howto/functional.rst4
-rw-r--r--Doc/howto/regex.rst2
-rw-r--r--Doc/howto/sorting.rst6
-rw-r--r--Doc/howto/unicode.rst8
4 files changed, 11 insertions, 9 deletions
diff --git a/Doc/howto/functional.rst b/Doc/howto/functional.rst
index 5cf12cc..b0f9d22 100644
--- a/Doc/howto/functional.rst
+++ b/Doc/howto/functional.rst
@@ -1072,8 +1072,8 @@ write the obvious :keyword:`for` loop::
A related function is :func:`itertools.accumulate(iterable, func=operator.add)
<itertools.accumulate>`. It performs the same calculation, but instead of
-returning only the final result, :func:`accumulate` returns an iterator that
-also yields each partial result::
+returning only the final result, :func:`~itertools.accumulate` returns an iterator
+that also yields each partial result::
itertools.accumulate([1, 2, 3, 4, 5]) =>
1, 3, 6, 10, 15
diff --git a/Doc/howto/regex.rst b/Doc/howto/regex.rst
index 655df59..c19c483 100644
--- a/Doc/howto/regex.rst
+++ b/Doc/howto/regex.rst
@@ -518,6 +518,8 @@ cache.
Compilation Flags
-----------------
+.. currentmodule:: re
+
Compilation flags let you modify some aspects of how regular expressions work.
Flags are available in the :mod:`re` module under two names, a long name such as
:const:`IGNORECASE` and a short, one-letter form such as :const:`I`. (If you're
diff --git a/Doc/howto/sorting.rst b/Doc/howto/sorting.rst
index decce12..38dd09f 100644
--- a/Doc/howto/sorting.rst
+++ b/Doc/howto/sorting.rst
@@ -273,7 +273,7 @@ Odds and Ends
* The sort routines use ``<`` when making comparisons
between two objects. So, it is easy to add a standard sort order to a class by
- defining an :meth:`__lt__` method:
+ defining an :meth:`~object.__lt__` method:
.. doctest::
@@ -281,8 +281,8 @@ Odds and Ends
>>> sorted(student_objects)
[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]
- However, note that ``<`` can fall back to using :meth:`__gt__` if
- :meth:`__lt__` is not implemented (see :func:`object.__lt__`).
+ However, note that ``<`` can fall back to using :meth:`~object.__gt__` if
+ :meth:`~object.__lt__` is not implemented (see :func:`object.__lt__`).
* Key functions need not depend directly on the objects being sorted. A key
function can also access external resources. For instance, if the student grades
diff --git a/Doc/howto/unicode.rst b/Doc/howto/unicode.rst
index b0faa68..254fe72 100644
--- a/Doc/howto/unicode.rst
+++ b/Doc/howto/unicode.rst
@@ -424,8 +424,8 @@ lowercase letters 'ss'.
A second tool is the :mod:`unicodedata` module's
:func:`~unicodedata.normalize` function that converts strings to one
-of several normal forms, where letters followed by a combining
-character are replaced with single characters. :func:`normalize` can
+of several normal forms, where letters followed by a combining character are
+replaced with single characters. :func:`~unicodedata.normalize` can
be used to perform string comparisons that won't falsely report
inequality if two strings use combining characters differently:
@@ -474,8 +474,8 @@ The Unicode Standard also specifies how to do caseless comparisons::
print(compare_caseless(single_char, multiple_chars))
-This will print ``True``. (Why is :func:`NFD` invoked twice? Because
-there are a few characters that make :meth:`casefold` return a
+This will print ``True``. (Why is :func:`!NFD` invoked twice? Because
+there are a few characters that make :meth:`~str.casefold` return a
non-normalized string, so the result needs to be normalized again. See
section 3.13 of the Unicode Standard for a discussion and an example.)