Eli Bendersky avatar Eli Bendersky committed 80a3bf8 Merge

Merge from 3.2: Issue #12644: document the '%a' conversion in the old string formatting operations. Patch prepared together with Ezio Melotti

Comments (0)

Files changed (1)

Doc/library/stdtypes.rst

    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.
 
 | ``'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.                            |       |
 +------------+-----------------------------------------------------+-------+
    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)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.