diff options
author | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-11-28 09:38:40 (GMT) |
---|---|---|
committer | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-11-28 09:38:40 (GMT) |
commit | bb4e941c6d721c2461f7dd30a84565abc350eca3 (patch) | |
tree | 89bb8aeaea4994f87861f60b97aa0bb833732ff1 /Doc/reference | |
parent | 21602183cea18c3222d04a4f9225c16421e286a2 (diff) | |
download | cpython-bb4e941c6d721c2461f7dd30a84565abc350eca3.zip cpython-bb4e941c6d721c2461f7dd30a84565abc350eca3.tar.gz cpython-bb4e941c6d721c2461f7dd30a84565abc350eca3.tar.bz2 |
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.
Diffstat (limited to 'Doc/reference')
-rw-r--r-- | Doc/reference/datamodel.rst | 12 |
1 files changed, 7 insertions, 5 deletions
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 @@ Sequences 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 @@ Basic customization Called by :func:`bytes` to compute a byte-string representation of an object. This should return a ``bytes`` object. - -.. method:: object.__format__(self, format_spec) - .. index:: + single: string; __format__() (object method) pair: string; conversion - builtin: str builtin: print + +.. method:: object.__format__(self, format_spec) + 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 |