[Python-checkins] cpython (3.2): Issue #12644: document the '%a' conversion in the old string formatting
eli.bendersky
python-checkins at python.org
Fri Jul 29 08:35:47 CEST 2011
http://hg.python.org/cpython/rev/9846f6463f23
changeset: 71544:9846f6463f23
branch: 3.2
parent: 71540:3e26c9033306
user: Eli Bendersky <eliben at gmail.com>
date: Fri Jul 29 09:30:42 2011 +0300
summary:
Issue #12644: document the '%a' conversion in the old string formatting operations. Patch prepared together with Ezio Melotti
files:
Doc/library/stdtypes.rst | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -1464,7 +1464,7 @@
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 @@
| ``'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 @@
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)
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list