summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2012-08-19 21:26:34 (GMT)
committerR David Murray <rdmurray@bitdance.com>2012-08-19 21:26:34 (GMT)
commite56bf97ef4283a877c459390516bb7385e8e4ec4 (patch)
treed175af7fff6eeacc8c58a7bdad0a0f546063b292 /Doc
parent828607170da3986af909defe99f956e5762e4dd0 (diff)
downloadcpython-e56bf97ef4283a877c459390516bb7385e8e4ec4.zip
cpython-e56bf97ef4283a877c459390516bb7385e8e4ec4.tar.gz
cpython-e56bf97ef4283a877c459390516bb7385e8e4ec4.tar.bz2
#13579: teach string.Formatter about 'a'.
Patch by Francisco Martín Brugué.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/string.rst11
1 files changed, 6 insertions, 5 deletions
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index aed191b..79d4e3f 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -91,8 +91,8 @@ implementation as the built-in :meth:`format` method.
.. method:: format(format_string, *args, **kwargs)
- :meth:`format` is the primary API method. It takes a format template
- string, and an arbitrary set of positional and keyword argument.
+ :meth:`format` is the primary API method. It takes a format string and
+ an arbitrary set of positional and keyword arguments.
:meth:`format` is just a wrapper that calls :meth:`vformat`.
.. method:: vformat(format_string, args, kwargs)
@@ -101,8 +101,8 @@ implementation as the built-in :meth:`format` method.
separate function for cases where you want to pass in a predefined
dictionary of arguments, rather than unpacking and repacking the
dictionary as individual arguments using the ``*args`` and ``**kwds``
- syntax. :meth:`vformat` does the work of breaking up the format template
- string into character data and replacement fields. It calls the various
+ syntax. :meth:`vformat` does the work of breaking up the format string
+ into character data and replacement fields. It calls the various
methods described below.
In addition, the :class:`Formatter` defines a number of methods that are
@@ -173,7 +173,8 @@ implementation as the built-in :meth:`format` method.
Converts the value (returned by :meth:`get_field`) given a conversion type
(as in the tuple returned by the :meth:`parse` method). The default
- version understands 'r' (repr) and 's' (str) conversion types.
+ version understands 's' (str), 'r' (repr) and 'a' (ascii) conversion
+ types.
.. _formatstrings: