Skip to content

Commit a0d940d

Browse files
authored
Misc copyedits in docs on built-in types (GH-24466)
# DOC: Improvements in library/stdtypes This PR does the following: 1. Replaces :meth: by :func: around repr function 2. Adds links to Unicode Standard site 3. Makes explicit "when" you can call the `iskeyword` function. The previous text could cause confusion to readers, especially those with English as a second language. The reader could understand that the `isidentifier` method calls the `iskeyword` function. Now, it is explicit that the dev can do it. 4. Replaces a URL with an inline link. Automerge-Triggered-By: GH:AlexWaygood
1 parent 12b5a3c commit a0d940d

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

Doc/library/stdtypes.rst

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ Notes:
353353
The numeric literals accepted include the digits ``0`` to ``9`` or any
354354
Unicode equivalent (code points with the ``Nd`` property).
355355

356-
See https://www.unicode.org/Public/15.0.0/ucd/extracted/DerivedNumericType.txt
356+
See `the Unicode Standard <https://unicode.org/Public/UNIDATA/extracted/DerivedNumericType.txt>`_
357357
for a complete list of code points with the ``Nd`` property.
358358

359359

@@ -1522,7 +1522,7 @@ multiple fragments.
15221522
printable string representation of *object*. For string objects, this is
15231523
the string itself. If *object* does not have a :meth:`~object.__str__`
15241524
method, then :func:`str` falls back to returning
1525-
:meth:`repr(object) <repr>`.
1525+
:func:`repr(object) <repr>`.
15261526

15271527
.. index::
15281528
single: buffer protocol; str (built-in class)
@@ -1597,8 +1597,9 @@ expression support in the :mod:`re` module).
15971597
lowercase, :meth:`lower` would do nothing to ``'ß'``; :meth:`casefold`
15981598
converts it to ``"ss"``.
15991599

1600-
The casefolding algorithm is described in section 3.13 of the Unicode
1601-
Standard.
1600+
The casefolding algorithm is
1601+
`described in section 3.13 of the Unicode Standard
1602+
<http://www.unicode.org/versions/Unicode15.0.0/ch03.pdf#G53253>`__.
16021603

16031604
.. versionadded:: 3.3
16041605

@@ -1757,7 +1758,8 @@ expression support in the :mod:`re` module).
17571758
one character, ``False`` otherwise. Alphabetic characters are those characters defined
17581759
in the Unicode character database as "Letter", i.e., those with general category
17591760
property being one of "Lm", "Lt", "Lu", "Ll", or "Lo". Note that this is different
1760-
from the "Alphabetic" property defined in the Unicode Standard.
1761+
from the `Alphabetic property defined in the Unicode Standard
1762+
<https://www.unicode.org/versions/Unicode15.0.0/ch04.pdf#G91002>`_.
17611763

17621764

17631765
.. method:: str.isascii()
@@ -1794,7 +1796,7 @@ expression support in the :mod:`re` module).
17941796
Return ``True`` if the string is a valid identifier according to the language
17951797
definition, section :ref:`identifiers`.
17961798

1797-
Call :func:`keyword.iskeyword` to test whether string ``s`` is a reserved
1799+
:func:`keyword.iskeyword` can be used to test whether string ``s`` is a reserved
17981800
identifier, such as :keyword:`def` and :keyword:`class`.
17991801

18001802
Example:
@@ -1891,8 +1893,9 @@ expression support in the :mod:`re` module).
18911893
Return a copy of the string with all the cased characters [4]_ converted to
18921894
lowercase.
18931895

1894-
The lowercasing algorithm used is described in section 3.13 of the Unicode
1895-
Standard.
1896+
The lowercasing algorithm used is
1897+
`described in section 3.13 of the Unicode Standard
1898+
<https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf#G34078>`__.
18961899

18971900

18981901
.. method:: str.lstrip([chars])
@@ -2236,8 +2239,9 @@ expression support in the :mod:`re` module).
22362239
character(s) is not "Lu" (Letter, uppercase), but e.g. "Lt" (Letter,
22372240
titlecase).
22382241

2239-
The uppercasing algorithm used is described in section 3.13 of the Unicode
2240-
Standard.
2242+
The uppercasing algorithm used is
2243+
`described in section 3.13 of the Unicode Standard
2244+
<https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf#G34078>`__.
22412245

22422246

22432247
.. method:: str.zfill(width)

0 commit comments

Comments
 (0)