This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Template string docs refer to "normal %-based substitutions"
Type: Stage:
Components: Documentation Versions: Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: barry, docs@python, rhettinger, terry.reedy, v+python
Priority: normal Keywords:

Created on 2017-12-09 21:36 by v+python, last changed 2022-04-11 14:58 by admin.

Messages (5)
msg307922 - (view) Author: Glenn Linderman (v+python) * Date: 2017-12-09 21:36
At least as far back as Python 3.1, the description for Template strings (section 6.1.5 in version 3.6.4rc1 docs) starts by differentiating what Template strings do, as:

Instead of the normal %-based substitutions, Templates support $-based substitutions, using the following rules:

Since this immediately follows a section describing the "Custom String Formatting" and the "Format Specification Mini-Language", which does a type of substitutions that is {} based, rather than % based, it is hard to grasp exactly why %-based substitutions would be considered "normal". Of course, I know why, due to the % operator, but for someone just reading through chapter 6, it is a reference that raises the mental question "Huh? What is normal %-based substitution? Are Templates abnormal, if %-based substitutions are normal? What did I miss? The previous section was about {}-based substitutions? Are they abnormal, too? What are normal %-based substitutions, anyway?" rather than helping to describe what Templates are and do.
msg307975 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2017-12-10 19:36
We can remove the word "normal" but otherwise the docs read fairly well.

FWIW, when there docs were written, the {} new-style string formatting didn't exist, so the wording was reasonable at the time.
msg307996 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2017-12-10 22:10
On Dec 10, 2017, at 14:36, Raymond Hettinger <report@bugs.python.org> wrote:
> 
> Raymond Hettinger <raymond.hettinger@gmail.com> added the comment:
> 
> We can remove the word "normal" but otherwise the docs read fairly well.

+1

> FWIW, when there docs were written, the {} new-style string formatting didn't exist, so the wording was reasonable at the time.

Exactly.
msg308013 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2017-12-11 04:25
FWIW, this was already fixed in the 3.7 docs.  I don't feel any real need to backport it.
msg308449 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-12-16 03:57
https://github.com/python/cpython/commit/9f74deba784fc8781d13ed564f69c02ed7c331bb

merged by Warsaw (last March).  It removed the whole phrase, "Instead of the normal %-based substitutions,"  I think the other changes would be more worth backporting, (assuming correct for 3.6, which I believe they are) if anything is.
History
Date User Action Args
2022-04-11 14:58:55adminsetgithub: 76444
2017-12-16 03:57:44terry.reedysetnosy: + terry.reedy
messages: + msg308449
2017-12-11 04:26:05rhettingersetversions: - Python 3.4, Python 3.5, Python 3.7, Python 3.8
2017-12-11 04:25:53rhettingersetassignee: rhettinger ->
messages: + msg308013
2017-12-10 22:10:57barrysetmessages: + msg307996
2017-12-10 19:36:04rhettingersetassignee: docs@python -> rhettinger

messages: + msg307975
nosy: + rhettinger
2017-12-09 21:58:25barrysetnosy: + barry
2017-12-09 21:36:38v+pythoncreate