mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
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.
This commit is contained in:
parent
21602183ce
commit
bb4e941c6d
6 changed files with 79 additions and 57 deletions
|
@ -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.
|
||||
|
||||
.. 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue