Skip to content

Commit 92af0cc

Browse files
gh-109634: Use :samp: role (GH-109635)
1 parent 5e7ea95 commit 92af0cc

30 files changed

+99
-95
lines changed

Doc/extending/windows.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,4 @@ modules (including Python) to be able to see your identifiers, you have to say
132132
Developer Studio will throw in a lot of import libraries that you do not really
133133
need, adding about 100K to your executable. To get rid of them, use the Project
134134
Settings dialog, Link tab, to specify *ignore default libraries*. Add the
135-
correct :file:`msvcrtxx.lib` to the list of libraries.
135+
correct :file:`msvcrt{xx}.lib` to the list of libraries.

Doc/howto/logging-cookbook.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,7 +1728,7 @@ when (and if) the logged message is actually about to be output to a log by a
17281728
handler. So the only slightly unusual thing which might trip you up is that the
17291729
parentheses go around the format string and the arguments, not just the format
17301730
string. That's because the __ notation is just syntax sugar for a constructor
1731-
call to one of the XXXMessage classes.
1731+
call to one of the :samp:`{XXX}Message` classes.
17321732

17331733
If you prefer, you can use a :class:`LoggerAdapter` to achieve a similar effect
17341734
to the above, as in the following example::
@@ -2644,7 +2644,7 @@ when (and if) the logged message is actually about to be output to a log by a
26442644
handler. So the only slightly unusual thing which might trip you up is that the
26452645
parentheses go around the format string and the arguments, not just the format
26462646
string. That’s because the __ notation is just syntax sugar for a constructor
2647-
call to one of the ``XXXMessage`` classes shown above.
2647+
call to one of the :samp:`{XXX}Message` classes shown above.
26482648

26492649

26502650
.. _filters-dictconfig:

Doc/howto/logging.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ provided:
979979

980980
#. :class:`NullHandler` instances do nothing with error messages. They are used
981981
by library developers who want to use logging, but want to avoid the 'No
982-
handlers could be found for logger XXX' message which can be displayed if
982+
handlers could be found for logger *XXX*' message which can be displayed if
983983
the library user has not configured logging. See :ref:`library-config` for
984984
more information.
985985

Doc/library/codecs.rst

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,10 @@ The following error handlers can be used with all Python
345345
+-------------------------+-----------------------------------------------+
346346
| ``'backslashreplace'`` | Replace with backslashed escape sequences. |
347347
| | On encoding, use hexadecimal form of Unicode |
348-
| | code point with formats ``\xhh`` ``\uxxxx`` |
349-
| | ``\Uxxxxxxxx``. On decoding, use hexadecimal |
350-
| | form of byte value with format ``\xhh``. |
348+
| | code point with formats :samp:`\\x{hh}` |
349+
| | :samp:`\\u{xxxx}` :samp:`\\U{xxxxxxxx}`. |
350+
| | On decoding, use hexadecimal form of byte |
351+
| | value with format :samp:`\\x{hh}`. |
351352
| | Implemented in |
352353
| | :func:`backslashreplace_errors`. |
353354
+-------------------------+-----------------------------------------------+
@@ -373,8 +374,9 @@ The following error handlers are only applicable to encoding (within
373374
+=========================+===============================================+
374375
| ``'xmlcharrefreplace'`` | Replace with XML/HTML numeric character |
375376
| | reference, which is a decimal form of Unicode |
376-
| | code point with format ``&#num;`` Implemented |
377-
| | in :func:`xmlcharrefreplace_errors`. |
377+
| | code point with format :samp:`&#{num};`. |
378+
| | Implemented in |
379+
| | :func:`xmlcharrefreplace_errors`. |
378380
+-------------------------+-----------------------------------------------+
379381
| ``'namereplace'`` | Replace with ``\N{...}`` escape sequences, |
380382
| | what appears in the braces is the Name |
@@ -478,8 +480,9 @@ functions:
478480

479481
Malformed data is replaced by a backslashed escape sequence.
480482
On encoding, use the hexadecimal form of Unicode code point with formats
481-
``\xhh`` ``\uxxxx`` ``\Uxxxxxxxx``. On decoding, use the hexadecimal form of
482-
byte value with format ``\xhh``.
483+
:samp:`\\x{hh}` :samp:`\\u{xxxx}` :samp:`\\U{xxxxxxxx}`.
484+
On decoding, use the hexadecimal form of
485+
byte value with format :samp:`\\x{hh}`.
483486

484487
.. versionchanged:: 3.5
485488
Works with decoding and translating.
@@ -492,7 +495,7 @@ functions:
492495

493496
The unencodable character is replaced by an appropriate XML/HTML numeric
494497
character reference, which is a decimal form of Unicode code point with
495-
format ``&#num;`` .
498+
format :samp:`&#{num};` .
496499

497500

498501
.. function:: namereplace_errors(exception)
@@ -1346,9 +1349,10 @@ encodings.
13461349
| | | supported. |
13471350
+--------------------+---------+---------------------------+
13481351
| raw_unicode_escape | | Latin-1 encoding with |
1349-
| | | ``\uXXXX`` and |
1350-
| | | ``\UXXXXXXXX`` for other |
1351-
| | | code points. Existing |
1352+
| | | :samp:`\\u{XXXX}` and |
1353+
| | | :samp:`\\U{XXXXXXXX}`` |
1354+
| | | for other code points. |
1355+
| | | Existing |
13521356
| | | backslashes are not |
13531357
| | | escaped in any way. |
13541358
| | | It is used in the Python |

Doc/library/compileall.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ compile Python sources.
3131

3232
Positional arguments are files to compile or directories that contain
3333
source files, traversed recursively. If no argument is given, behave as if
34-
the command line was ``-l <directories from sys.path>``.
34+
the command line was :samp:`-l {<directories from sys.path>}`.
3535

3636
.. cmdoption:: -l
3737

Doc/library/ensurepip.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ By default, ``pip`` is installed into the current virtual environment
6161
active virtual environment). The installation location can be controlled
6262
through two additional command line options:
6363

64-
* ``--root <dir>``: Installs ``pip`` relative to the given root directory
64+
* :samp:`--root {dir}`: Installs ``pip`` relative to the given root directory
6565
rather than the root of the currently active virtual environment (if any)
6666
or the default root for the current Python installation.
6767
* ``--user``: Installs ``pip`` into the user site packages directory rather

Doc/library/functions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@ are always available. They are listed here in alphabetical order.
12711271

12721272
* ``'xmlcharrefreplace'`` is only supported when writing to a file.
12731273
Characters not supported by the encoding are replaced with the
1274-
appropriate XML character reference ``&#nnn;``.
1274+
appropriate XML character reference :samp:`&#{nnn};`.
12751275

12761276
* ``'backslashreplace'`` replaces malformed data by Python's backslashed
12771277
escape sequences.

Doc/library/html.parser.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ implementations do nothing (except for :meth:`~HTMLParser.handle_startendtag`):
173173
.. method:: HTMLParser.handle_charref(name)
174174

175175
This method is called to process decimal and hexadecimal numeric character
176-
references of the form ``&#NNN;`` and ``&#xNNN;``. For example, the decimal
176+
references of the form :samp:`&#{NNN};` and :samp:`&#x{NNN};`. For example, the decimal
177177
equivalent for ``&gt;`` is ``&#62;``, whereas the hexadecimal is ``&#x3E;``;
178178
in this case the method will receive ``'62'`` or ``'x3E'``. This method
179179
is never called if *convert_charrefs* is ``True``.

Doc/library/http.server.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ provides three different variants:
217217
attribute holds the default values for *message* and *explain* that
218218
will be used if no value is provided; for unknown codes the default value
219219
for both is the string ``???``. The body will be empty if the method is
220-
HEAD or the response code is one of the following: ``1xx``,
220+
HEAD or the response code is one of the following: :samp:`1{xx}`,
221221
``204 No Content``, ``205 Reset Content``, ``304 Not Modified``.
222222

223223
.. versionchanged:: 3.4

Doc/library/os.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ startup by the :c:func:`PyConfig_Read` function: see
8888
On some systems, conversion using the file system encoding may fail. In this
8989
case, Python uses the :ref:`surrogateescape encoding error handler
9090
<surrogateescape>`, which means that undecodable bytes are replaced by a
91-
Unicode character U+DCxx on decoding, and these are again translated to the
92-
original byte on encoding.
91+
Unicode character U+DC\ *xx* on decoding, and these are again
92+
translated to the original byte on encoding.
9393

9494

9595
The :term:`file system encoding <filesystem encoding and error handler>` must

0 commit comments

Comments
 (0)