diff options
author | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-11-28 09:45:15 (GMT) |
---|---|---|
committer | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-11-28 09:45:15 (GMT) |
commit | 16459e8b16dfa00bd9f0f1a6b1d7989dd1d4b93e (patch) | |
tree | 4f86872908d34c6f492e292a88645a69549a8021 /Doc/reference | |
parent | bff98fe5364452775d8273137c9087ed004deb96 (diff) | |
parent | bb4e941c6d721c2461f7dd30a84565abc350eca3 (diff) | |
download | cpython-16459e8b16dfa00bd9f0f1a6b1d7989dd1d4b93e.zip cpython-16459e8b16dfa00bd9f0f1a6b1d7989dd1d4b93e.tar.gz cpython-16459e8b16dfa00bd9f0f1a6b1d7989dd1d4b93e.tar.bz2 |
Merge from 3.3: Add a str class entry to the string 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 25ec2d6..9a39eb4 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 |