summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2011-07-29 06:30:42 (GMT)
committerEli Bendersky <eliben@gmail.com>2011-07-29 06:30:42 (GMT)
commitef4902af879cd571e3b57d745c355f255daa09af (patch)
treee25f69b7683bbdecf753858efcd8e48fe5d6e67e /Doc/library
parent7c9719cf74a4c5fc04a07b706d71302bdd8c04c5 (diff)
downloadcpython-ef4902af879cd571e3b57d745c355f255daa09af.zip
cpython-ef4902af879cd571e3b57d745c355f255daa09af.tar.gz
cpython-ef4902af879cd571e3b57d745c355f255daa09af.tar.bz2
Issue #12644: document the '%a' conversion in the old string formatting operations. Patch prepared together with Ezio Melotti
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/stdtypes.rst9
1 files changed, 6 insertions, 3 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index f0933a5..e43fc04 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -1464,7 +1464,7 @@ components, which must occur in this order:
object to convert comes after the minimum field width and optional precision.
#. Precision (optional), given as a ``'.'`` (dot) followed by the precision. If
- specified as ``'*'`` (an asterisk), the actual width is read from the next
+ specified as ``'*'`` (an asterisk), the actual precision is read from the next
element of the tuple in *values*, and the value to convert comes after the
precision.
@@ -1546,9 +1546,12 @@ The conversion types are:
| ``'r'`` | String (converts any Python object using | \(5) |
| | :func:`repr`). | |
+------------+-----------------------------------------------------+-------+
-| ``'s'`` | String (converts any Python object using | |
+| ``'s'`` | String (converts any Python object using | \(5) |
| | :func:`str`). | |
+------------+-----------------------------------------------------+-------+
+| ``'a'`` | String (converts any Python object using | \(5) |
+| | :func:`ascii`). | |
++------------+-----------------------------------------------------+-------+
| ``'%'`` | No argument is converted, results in a ``'%'`` | |
| | character in the result. | |
+------------+-----------------------------------------------------+-------+
@@ -1581,7 +1584,7 @@ Notes:
decimal point and defaults to 6.
(5)
- The precision determines the maximal number of characters used.
+ If precision is ``N``, the output is truncated to ``N`` characters.
(7)