classification
Title: document the "%a" conversion in the old string formatting operations
Type: Stage: commit review
Components: Documentation Versions: Python 3.2, Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eli.bendersky Nosy List: docs@python, eli.bendersky, eric.araujo, ezio.melotti, python-dev
Priority: low Keywords: easy, patch

Created on 2011-07-27 14:29 by eli.bendersky, last changed 2011-07-29 06:49 by eli.bendersky. This issue is now closed.

Files
File name Uploaded Description Edit
issue12644.diff ezio.melotti, 2011-07-27 14:42 review
Messages (8)
msg141228 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2011-07-27 14:29
The 'a' conversion type isn't documented in library/stdtypes.rst
msg141229 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-07-27 14:45
I don’t think anyone could find anything wrong with the patch.
msg141243 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2011-07-27 16:54
%r has note (5) saying "The precision determines the maximal number of characters used."

Does this apply to %a as well?

Other than that, LGTM
msg141245 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2011-07-27 16:57
ISTM that it applies to both %s and %a, but the note is wrong/imprecise.

The precision determines where the string is truncated, but the actual number of characters is given by the field width.
msg141246 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2011-07-27 17:08
Yeah, the note should probably be clarified to mention that if precision is specified, only the first precision characters will be shown. The field width is covered globally (for all conversion types) in note 4 above the table.

While we're at it, note 5 is:

   Precision (optional), given as a '.' (dot) followed by the precision. If specified as '*' (an asterisk), the actual width is read from the next element of the tuple in values, and the value to convert comes after the precision.

I think that the second sentence should have "the actual precision" instead "the actual width".
msg141331 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-07-29 06:35
New changeset 9846f6463f23 by Eli Bendersky in branch '3.2':
Issue #12644: document the '%a' conversion in the old string formatting operations. Patch prepared together with Ezio Melotti
http://hg.python.org/cpython/rev/9846f6463f23

New changeset 80a3bf889cf6 by Eli Bendersky in branch 'default':
Merge from 3.2: Issue #12644: document the '%a' conversion in the old string formatting operations. Patch prepared together with Ezio Melotti
http://hg.python.org/cpython/rev/80a3bf889cf6
msg141332 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2011-07-29 06:43
Ezio, I've taken the liberty to adapt your patch with the suggested fixes and commit it to both 3.2 and 3.3

If everything is OK, this issue can be close (I'll do it in a few days if no one else does :-)
msg141333 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2011-07-29 06:47
The commit looks fine, the issue can be closed.
History
Date User Action Args
2011-07-29 06:49:34eli.benderskysetstatus: open -> closed
resolution: fixed
2011-07-29 06:47:46ezio.melottisetmessages: + msg141333
2011-07-29 06:43:33eli.benderskysetmessages: + msg141332
2011-07-29 06:35:48python-devsetnosy: + python-dev
messages: + msg141331
2011-07-27 17:08:31eli.benderskysetmessages: + msg141246
2011-07-27 16:57:00ezio.melottisetnosy: + ezio.melotti
messages: + msg141245
2011-07-27 16:54:56eli.benderskysetmessages: + msg141243
2011-07-27 14:45:45eric.araujosetmessages: + msg141229
stage: patch review -> commit review
2011-07-27 14:44:34eric.araujosetnosy: + eric.araujo, docs@python
2011-07-27 14:42:26ezio.melottisetkeywords: + patch, easy, - gsoc
files: + issue12644.diff
stage: patch review
2011-07-27 14:29:13eli.benderskycreate