classification
Title: Tutorial: rearrange discussion of output formatting to encourage f-strings
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: akuchling, cheryl.sabella, docs@python, miss-islington, rhettinger
Priority: normal Keywords:

Created on 2016-11-06 17:20 by akuchling, last changed 2019-04-10 12:19 by cheryl.sabella. This issue is now closed.

Files
File name Uploaded Description Edit
tutorial-patch.txt akuchling, 2016-11-06 17:20 review
Pull Requests
URL Status Linked Edit
PR 6036 merged akuchling, 2018-03-09 02:36
PR 8174 merged miss-islington, 2018-07-07 21:37
Messages (6)
msg280153 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2016-11-06 17:20
The 'output formatting' section of the tutorial talks a lot about manual formatting with things like .rjust() and .zfill(), with only a passing reference to 3.6's new f-strings.

The attached patch doesn't drop all of the old material, but it does rearrange the topics into a more modern order: f-strings first, featuring the discussion of formatting specifiers; then calling .format(); finally manual formatting with .ljust().

Open question:
msg280155 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2016-11-06 17:26
Oh, I didn't finish my thought on open questions: should we just drop the discussion of .ljust(), .zfill(), or should it be there so users are aware of it?  Similarly, is it still worth mentioning string.Template?
msg280638 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2016-11-12 08:15
It makes sense to drop zfill() and ljust().  If there is any mention of string.Template, it could be limited to mentioning why you would want to use it (i.e. is a great format to expose to non-programmer end-users) and include a reference to the string.Template docs.
msg313218 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2018-03-04 19:37
@akuchling

Would you be able to make a PR for this patch?  Thanks.
msg321240 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2018-07-07 21:36
New changeset ced350b1952857a9b9c68ec7e2786358bcb61050 by Andrew Kuchling in branch 'master':
bpo-28626: rearrange discussion of output formatting to encourage f-strings (#6036)
https://github.com/python/cpython/commit/ced350b1952857a9b9c68ec7e2786358bcb61050
msg321320 - (view) Author: miss-islington (miss-islington) Date: 2018-07-09 13:52
New changeset 80a5f04592f7d732a541d5c35a1be1e9a6472ecb by Miss Islington (bot) in branch '3.7':
bpo-28626: rearrange discussion of output formatting to encourage f-strings (GH-6036)
https://github.com/python/cpython/commit/80a5f04592f7d732a541d5c35a1be1e9a6472ecb
History
Date User Action Args
2019-04-10 12:19:35cheryl.sabellasetkeywords: - patch, needs review
status: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-07-09 13:52:51miss-islingtonsetnosy: + miss-islington
messages: + msg321320
2018-07-07 21:37:46miss-islingtonsetpull_requests: + pull_request7731
2018-07-07 21:36:25akuchlingsetmessages: + msg321240
2018-03-09 02:36:34akuchlingsetpull_requests: + pull_request5798
2018-03-04 19:37:26cheryl.sabellasetnosy: + cheryl.sabella

messages: + msg313218
versions: + Python 3.8, - Python 3.6
2016-11-12 08:15:12rhettingersetnosy: + rhettinger
messages: + msg280638
2016-11-06 17:26:25akuchlingsetmessages: + msg280155
2016-11-06 17:20:55akuchlingcreate