Skip to content

Commit 7f83592

Browse files
gh-71223: Improve rendering of some references in the docs (GH-93041)
For example, instead of "eval()uated" (link from "eval()") show "evaluated" (link from the whole word).
1 parent 2fadde7 commit 7f83592

File tree

7 files changed

+16
-9
lines changed

7 files changed

+16
-9
lines changed

Doc/library/email.headerregistry.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ headers.
206206

207207
The ``decoded`` value of the header will have all encoded words decoded to
208208
unicode. :class:`~encodings.idna` encoded domain names are also decoded to
209-
unicode. The ``decoded`` value is set by :attr:`~str.join`\ ing the
209+
unicode. The ``decoded`` value is set by :ref:`joining <meth-str-join>` the
210210
:class:`str` value of the elements of the ``groups`` attribute with ``',
211211
'``.
212212

Doc/library/functions.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ are always available. They are listed here in alphabetical order.
500500
yield n, elem
501501
n += 1
502502

503+
.. _func-eval:
503504

504505
.. function:: eval(expression[, globals[, locals]])
505506

Doc/library/logging.config.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ root logger section is given below.
716716
717717
The ``level`` entry can be one of ``DEBUG, INFO, WARNING, ERROR, CRITICAL`` or
718718
``NOTSET``. For the root logger only, ``NOTSET`` means that all messages will be
719-
logged. Level values are :func:`eval`\ uated in the context of the ``logging``
719+
logged. Level values are :ref:`evaluated <func-eval>` in the context of the ``logging``
720720
package's namespace.
721721

722722
The ``handlers`` entry is a comma-separated list of handler names, which must
@@ -763,13 +763,13 @@ handler. If blank, a default formatter (``logging._defaultFormatter``) is used.
763763
If a name is specified, it must appear in the ``[formatters]`` section and have
764764
a corresponding section in the configuration file.
765765

766-
The ``args`` entry, when :func:`eval`\ uated in the context of the ``logging``
766+
The ``args`` entry, when :ref:`evaluated <func-eval>` in the context of the ``logging``
767767
package's namespace, is the list of arguments to the constructor for the handler
768768
class. Refer to the constructors for the relevant handlers, or to the examples
769769
below, to see how typical entries are constructed. If not provided, it defaults
770770
to ``()``.
771771

772-
The optional ``kwargs`` entry, when :func:`eval`\ uated in the context of the
772+
The optional ``kwargs`` entry, when :ref:`evaluated <func-eval>` in the context of the
773773
``logging`` package's namespace, is the keyword argument dict to the constructor
774774
for the handler class. If not provided, it defaults to ``{}``.
775775

Doc/library/stdtypes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,6 +1866,8 @@ expression support in the :mod:`re` module).
18661866

18671867

18681868

1869+
.. _meth-str-join:
1870+
18691871
.. method:: str.join(iterable)
18701872

18711873
Return a string which is the concatenation of the strings in *iterable*.

Doc/library/threading.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ There is the possibility that "dummy thread objects" are created. These are
293293
thread objects corresponding to "alien threads", which are threads of control
294294
started outside the threading module, such as directly from C code. Dummy
295295
thread objects have limited functionality; they are always considered alive and
296-
daemonic, and cannot be :meth:`~Thread.join`\ ed. They are never deleted,
296+
daemonic, and cannot be :ref:`joined <meth-thread-join>`. They are never deleted,
297297
since it is impossible to detect the termination of alien threads.
298298

299299

@@ -366,6 +366,8 @@ since it is impossible to detect the termination of alien threads.
366366
>>> t.run()
367367
1
368368

369+
.. _meth-thread-join:
370+
369371
.. method:: join(timeout=None)
370372

371373
Wait until the thread terminates. This blocks the calling thread until
@@ -383,7 +385,7 @@ since it is impossible to detect the termination of alien threads.
383385
When the *timeout* argument is not present or ``None``, the operation will
384386
block until the thread terminates.
385387

386-
A thread can be :meth:`~Thread.join`\ ed many times.
388+
A thread can be joined many times.
387389

388390
:meth:`~Thread.join` raises a :exc:`RuntimeError` if an attempt is made
389391
to join the current thread as that would cause a deadlock. It is also

Doc/library/weakref.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _mod-weakref:
2+
13
:mod:`weakref` --- Weak references
24
==================================
35

Doc/whatsnew/3.4.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ Some smaller changes made to the core Python language are:
409409
evaluating has no elements. (Contributed by Julian Berman in
410410
:issue:`18111`.)
411411

412-
* Module objects are now :mod:`weakref`'able.
412+
* Module objects are now :ref:`weakly referenceable <mod-weakref>`.
413413

414414
* Module ``__file__`` attributes (and related values) should now always
415415
contain absolute paths by default, with the sole exception of
@@ -1113,8 +1113,8 @@ with additional speedups by Antoine Pitrou in :issue:`19219`.)
11131113
mmap
11141114
----
11151115

1116-
mmap objects can now be :mod:`weakref`\ ed. (Contributed by Valerie Lambert in
1117-
:issue:`4885`.)
1116+
mmap objects are now :ref:`weakly referenceable <mod-weakref>`.
1117+
(Contributed by Valerie Lambert in :issue:`4885`.)
11181118

11191119

11201120
multiprocessing

0 commit comments

Comments
 (0)