@@ -14,7 +14,7 @@ are always available. They are listed here in alphabetical order.
1414:func: `all ` :func: `dir ` :func: `hex ` :func: `next ` :func: `slice `
1515:func: `any ` :func: `divmod ` :func: `id ` :func: `object ` :func: `sorted `
1616:func: `ascii ` :func: `enumerate ` :func: `input ` :func: `oct ` :func: `staticmethod `
17- :func: `bin ` :func: `eval ` :func: `int ` :func: `open ` : func: ` str `
17+ :func: `bin ` :func: `eval ` :func: `int ` :func: `open ` | func- str |_
1818:func: `bool ` :func: `exec ` :func: `isinstance ` :func: `ord ` :func: `sum `
1919:func: `bytearray ` :func: `filter ` :func: `issubclass ` :func: `pow ` :func: `super `
2020:func: `bytes ` :func: `float ` :func: `iter ` :func: `print ` |func-tuple |_
@@ -34,6 +34,7 @@ are always available. They are listed here in alphabetical order.
3434.. |func-memoryview | replace :: ``memoryview() ``
3535.. |func-set | replace :: ``set() ``
3636.. |func-list | replace :: ``list() ``
37+ .. |func-str | replace :: ``str() ``
3738.. |func-tuple | replace :: ``tuple() ``
3839.. |func-range | replace :: ``range() ``
3940
@@ -521,12 +522,12 @@ are always available. They are listed here in alphabetical order.
521522
522523 The float type is described in :ref: `typesnumeric `.
523524
524-
525- .. function :: format(value[, format_spec])
526-
527525 .. index ::
528- pair: str; format
529526 single: __format__
527+ single: string; format() (built-in function)
528+
529+
530+ .. function :: format(value[, format_spec])
530531
531532 Convert a *value * to a "formatted" representation, as controlled by
532533 *format_spec *. The interpretation of *format_spec * will depend on the type
@@ -1238,44 +1239,12 @@ are always available. They are listed here in alphabetical order.
12381239.. _func-str :
12391240.. function :: str(object='')
12401241 str(object=b'', encoding='utf-8', errors='strict')
1242+ :noindex:
12411243
1242- Return a :ref: `string <textseq >` version of *object *. If *object * is not
1243- provided, returns the empty string. Otherwise, the behavior of ``str() ``
1244- depends on whether *encoding * or *errors * is given, as follows.
1245-
1246- If neither *encoding * nor *errors * is given, ``str(object) `` returns
1247- :meth: `object.__str__() <object.__str__> `, which is the "informal" or nicely
1248- printable string representation of *object *. For string objects, this is
1249- the string itself. If *object * does not have a :meth: `~object.__str__ `
1250- method, then :func: `str ` falls back to returning
1251- :meth: `repr(object) <repr> `.
1244+ Return a :class: `str ` version of *object *. See :func: `str ` for details.
12521245
1253- .. index ::
1254- single: buffer protocol; str() (built-in function)
1255- single: bytes; str() (built-in function)
1256-
1257- If at least one of *encoding * or *errors * is given, *object * should be a
1258- :class: `bytes ` or :class: `bytearray ` object, or more generally any object
1259- that supports the :ref: `buffer protocol <bufferobjects >`. In this case, if
1260- *object * is a :class: `bytes ` (or :class: `bytearray `) object, then
1261- ``str(bytes, encoding, errors) `` is equivalent to
1262- :meth: `bytes.decode(encoding, errors) <bytes.decode> `. Otherwise, the bytes
1263- object underlying the buffer object is obtained before calling
1264- :meth: `bytes.decode `. See :ref: `binaryseq ` and
1265- :ref: `bufferobjects ` for information on buffer objects.
1266-
1267- Passing a :class: `bytes ` object to :func: `str ` without the *encoding *
1268- or *errors * arguments falls under the first case of returning the informal
1269- string representation (see also the :option: `-b ` command-line option to
1270- Python). For example::
1271-
1272- >>> str(b'Zoot!')
1273- "b'Zoot!'"
1274-
1275- ``str `` is a built-in :term: `type `. For more information on the string
1276- type and its methods, see the :ref: `textseq ` and :ref: `string-methods `
1277- sections. To output formatted strings, see the :ref: `string-formatting `
1278- section. In addition, see the :ref: `stringservices ` section.
1246+ ``str `` is the built-in string :term: `class `. For general information
1247+ about strings, see :ref: `textseq `.
12791248
12801249
12811250.. function :: sum(iterable[, start])
0 commit comments