Add a str class entry to the "Text Sequence Type" section (issue #16209).
This commit also moves the documentation for the str built-in function to
the new class entry. Links to :class:`str` now go to the class entry with
the string methods immediately afterwards.
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index b7a6736..7c51068 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -274,11 +274,13 @@
The following types are immutable sequences:
+ .. index::
+ single: string; immutable sequences
+
Strings
.. index::
builtin: chr
builtin: ord
- builtin: str
single: character
single: integer
single: Unicode
@@ -1188,14 +1190,14 @@
Called by :func:`bytes` to compute a byte-string representation of an
object. This should return a ``bytes`` object.
+ .. index::
+ single: string; __format__() (object method)
+ pair: string; conversion
+ builtin: print
+
.. method:: object.__format__(self, format_spec)
- .. index::
- pair: string; conversion
- builtin: str
- builtin: print
-
Called by the :func:`format` built-in function (and by extension, the
:meth:`str.format` method of class :class:`str`) to produce a "formatted"
string representation of an object. The ``format_spec`` argument is