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: Use en-dashes for ranges in docs
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.7, Python 3.6, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, ezio.melotti, mark.dickinson, martin.panter, python-dev, serhiy.storchaka, terry.reedy
Priority: normal Keywords: patch

Created on 2016-11-21 11:34 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
docs-en-dash.patch serhiy.storchaka, 2016-11-21 11:34 review
Messages (15)
msg281347 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-11-21 11:34
It is recommended to use an em-dash instead of a hyphen for numerical ranges. It looks better in the rendered document. Python documentation already use it, but not always. Proposed patch adds more en-dashes.
msg281358 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2016-11-21 14:06
While you are at it, have you checked how many en-dashes have been used instead of em-dashes?  "--" is commonly used to indicate em-dashes (e.g. in emails), but in rst it renders to an en-dash.
msg281360 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-11-21 14:25
353 en-dashes with spaces.
479 em-dashes with spaces.
89 em-dashes without spaces.

And some number of hyphens with spaces. It is hard to automatically distinguish them from minuses in code examples, but in issue18529 I provided large patches that converted all of them to dashes.
msg281361 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-11-21 14:41
Some of these double hyphens are in code examples. Thus the actual number of en-dashes that can be changed to em-dashes is smaller.
msg281421 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-11-22 00:53
Personally I prefer en dashes where practical, but I fear the change may conflict with other people’s styles and preferences. I quickly counted 22 single hyphens (obviously I missed a few that your patch caught) and also 22 existing en dashes.
msg281430 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-11-22 02:15
The rest single hyphens between digits are meaningful hypens in iso-8859-1, ISDNs, sample outputs, etc.
msg281431 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-11-22 02:32
Sure, I was just saying that for whatever reason, 50% of the documentation uses hyphens for number ranges, and 50% uses en dashes.
msg281446 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2016-11-22 08:56
> It is recommended to use an em-dash instead of a hyphen for numerical ranges.

Who makes that recommendation? Did you mean en-dash rather than em-dash?
msg281449 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2016-11-22 09:06
> Did you mean en-dash rather than em-dash?

Ah, judging by the title and the patch, you did. :-) Phew!

Now I can delete the long post I had citing multiple sources for using en-dashes (not em-dashes) for numeric ranges...
msg281450 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-11-22 09:08
My Australian Style Manual says to use en rules for spans of figures etc. Wikipedia mentions some other guides: <https://en.wikipedia.org/wiki/Dash#Ranges_of_values>; apparently some prefer the hyphen. That is why I said it is a style issue, not a black and white thing.
msg281451 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-11-22 09:16
Sorry, yes, I meant en-dashes of course. I read this recommendation in many books about TeX, and also in other typographic resources. In modern fonts a hyphen-minus (U+002D) is shorter than digits in modern fonts and is placed lower than the middle of digits. An en-dash (U+2013) has the same width as digits and is placed higher, at the middle of digit's height.
msg281461 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2016-11-22 10:42
> I read this recommendation in many books about TeX, and also in other typographic resources.

Same here. I'd add Apple's Style Guide and the Chicago Manual of Style to that list.
msg281747 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2016-11-25 22:23
I checked the patch with Rietveld and all the changes are '-' to '--' in numeric ranges in text. LGTM.
msg281769 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-11-26 11:50
New changeset 77307437ae15 by Serhiy Storchaka in branch '3.5':
Issue #28763: Use double hyphens (rendered as en-dashes) in numerical ranges
https://hg.python.org/cpython/rev/77307437ae15

New changeset 59bd48afa1bc by Serhiy Storchaka in branch '2.7':
Issue #28763: Use double hyphens (rendered as en-dashes) in numerical ranges
https://hg.python.org/cpython/rev/59bd48afa1bc

New changeset 3434d84efdd4 by Serhiy Storchaka in branch '3.6':
Issue #28763: Use double hyphens (rendered as en-dashes) in numerical ranges
https://hg.python.org/cpython/rev/3434d84efdd4

New changeset dc407f50e823 by Serhiy Storchaka in branch 'default':
Issue #28763: Use double hyphens (rendered as en-dashes) in numerical ranges
https://hg.python.org/cpython/rev/dc407f50e823
msg281770 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-11-26 11:51
Thanks Terry.
History
Date User Action Args
2022-04-11 14:58:39adminsetgithub: 72949
2016-11-26 11:51:30serhiy.storchakasetstatus: open -> closed
versions: + Python 2.7, Python 3.5, Python 3.6, Python 3.7
messages: + msg281770

resolution: fixed
stage: commit review -> resolved
2016-11-26 11:50:47python-devsetnosy: + python-dev
messages: + msg281769
2016-11-25 22:23:35terry.reedysetnosy: + terry.reedy

messages: + msg281747
stage: commit review
2016-11-22 10:42:55mark.dickinsonsetmessages: + msg281461
2016-11-22 09:16:45serhiy.storchakasetmessages: + msg281451
2016-11-22 09:08:29martin.pantersetmessages: + msg281450
2016-11-22 09:06:19mark.dickinsonsetmessages: + msg281449
2016-11-22 08:56:36mark.dickinsonsetnosy: + mark.dickinson
messages: + msg281446
2016-11-22 02:32:08martin.pantersetmessages: + msg281431
2016-11-22 02:15:07serhiy.storchakasetmessages: + msg281430
2016-11-22 00:53:42martin.pantersetmessages: + msg281421
2016-11-21 14:41:53serhiy.storchakasetmessages: + msg281361
2016-11-21 14:25:34serhiy.storchakasetmessages: + msg281360
2016-11-21 14:06:42ezio.melottisetnosy: + ezio.melotti
messages: + msg281358
2016-11-21 11:34:55serhiy.storchakacreate