Skip to content

Commit c7b1a0b

Browse files
Issue python#28763: Use double hyphens (rendered as en-dashes) in numerical ranges
in the documentation.
1 parent 4931122 commit c7b1a0b

File tree

17 files changed

+25
-25
lines changed

17 files changed

+25
-25
lines changed

Doc/faq/design.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ least slightly uneasy when reading (or being required to write) another style.
3131
Many coding styles place begin/end brackets on a line by themselves. This makes
3232
programs considerably longer and wastes valuable screen space, making it harder
3333
to get a good overview of a program. Ideally, a function should fit on one
34-
screen (say, 20-30 lines). 20 lines of Python can do a lot more work than 20
34+
screen (say, 20--30 lines). 20 lines of Python can do a lot more work than 20
3535
lines of C. This is not solely due to the lack of begin/end brackets -- the
3636
lack of declarations and the high-level data types are also responsible -- but
3737
the indentation-based syntax certainly helps.
@@ -77,7 +77,7 @@ which is exactly::
7777

7878
1.1999999999999999555910790149937383830547332763671875 (decimal)
7979

80-
The typical precision of 53 bits provides Python floats with 15-16
80+
The typical precision of 53 bits provides Python floats with 15--16
8181
decimal digits of accuracy.
8282

8383
For a fuller explanation, please see the :ref:`floating point arithmetic

Doc/faq/general.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ outdated.
252252

253253
Guido van Rossum and Jelke de Boer, "Interactively Testing Remote Servers
254254
Using the Python Programming Language", CWI Quarterly, Volume 4, Issue 4
255-
(December 1991), Amsterdam, pp 283-303.
255+
(December 1991), Amsterdam, pp 283--303.
256256

257257

258258
Are there any books on Python?

Doc/howto/urllib2.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ Error Codes
240240
~~~~~~~~~~~
241241

242242
Because the default handlers handle redirects (codes in the 300 range), and
243-
codes in the 100-299 range indicate success, you will usually only see error
244-
codes in the 400-599 range.
243+
codes in the 100--299 range indicate success, you will usually only see error
244+
codes in the 400--599 range.
245245

246246
:attr:`http.server.BaseHTTPRequestHandler.responses` is a useful dictionary of
247247
response codes in that shows all the response codes used by RFC 2616. The

Doc/library/calendar.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ it's the base calendar for all computations.
4747

4848
.. method:: itermonthdates(year, month)
4949

50-
Return an iterator for the month *month* (1-12) in the year *year*. This
50+
Return an iterator for the month *month* (1--12) in the year *year*. This
5151
iterator will return all days (as :class:`datetime.date` objects) for the
5252
month and all days before the start of the month or after the end of the
5353
month that are required to get a complete week.

Doc/library/cmath.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,6 @@ cuts for numerical purposes, a good reference should be the following:
275275

276276
Kahan, W: Branch cuts for complex elementary functions; or, Much ado about
277277
nothing's sign bit. In Iserles, A., and Powell, M. (eds.), The state of the art
278-
in numerical analysis. Clarendon Press (1987) pp165-211.
278+
in numerical analysis. Clarendon Press (1987) pp165--211.
279279

280280

Doc/library/codecs.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ Encodings and Unicode
858858
---------------------
859859

860860
Strings are stored internally as sequences of code points in
861-
range ``0x0``-``0x10FFFF``. (See :pep:`393` for
861+
range ``0x0``--``0x10FFFF``. (See :pep:`393` for
862862
more details about the implementation.)
863863
Once a string object is used outside of CPU and memory, endianness
864864
and how these arrays are stored as bytes become an issue. As with other
@@ -868,7 +868,7 @@ There are a variety of different text serialisation codecs, which are
868868
collectivity referred to as :term:`text encodings <text encoding>`.
869869

870870
The simplest text encoding (called ``'latin-1'`` or ``'iso-8859-1'``) maps
871-
the code points 0-255 to the bytes ``0x0``-``0xff``, which means that a string
871+
the code points 0--255 to the bytes ``0x0``--``0xff``, which means that a string
872872
object that contains code points above ``U+00FF`` can't be encoded with this
873873
codec. Doing so will raise a :exc:`UnicodeEncodeError` that looks
874874
like the following (although the details of the error message may differ):
@@ -877,7 +877,7 @@ position 3: ordinal not in range(256)``.
877877

878878
There's another group of encodings (the so called charmap encodings) that choose
879879
a different subset of all Unicode code points and how these code points are
880-
mapped to the bytes ``0x0``-``0xff``. To see how this is done simply open
880+
mapped to the bytes ``0x0``--``0xff``. To see how this is done simply open
881881
e.g. :file:`encodings/cp1252.py` (which is an encoding that is used primarily on
882882
Windows). There's a string constant with 256 characters that shows you which
883883
character is mapped to which byte value.

Doc/library/curses.ascii.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ it returns a string.
213213

214214
Return a string representation of the ASCII character *c*. If *c* is printable,
215215
this string is the character itself. If the character is a control character
216-
(0x00-0x1f) the string consists of a caret (``'^'``) followed by the
216+
(0x00--0x1f) the string consists of a caret (``'^'``) followed by the
217217
corresponding uppercase letter. If the character is an ASCII delete (0x7f) the
218218
string is ``'^?'``. If the character has its meta bit (0x80) set, the meta bit
219219
is stripped, the preceding rules applied, and ``'!'`` prepended to the result.

Doc/library/curses.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ The module :mod:`curses` defines the following functions:
316316
Return the name of the key numbered *k*. The name of a key generating printable
317317
ASCII character is the key's character. The name of a control-key combination
318318
is a two-character string consisting of a caret followed by the corresponding
319-
printable ASCII character. The name of an alt-key combination (128-255) is a
319+
printable ASCII character. The name of an alt-key combination (128--255) is a
320320
string consisting of the prefix 'M-' followed by the name of the corresponding
321321
ASCII character.
322322

Doc/library/functions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ are always available. They are listed here in alphabetical order.
686686
preceded by ``+`` or ``-`` (with no space in between) and surrounded by
687687
whitespace. A base-n literal consists of the digits 0 to n-1, with ``a``
688688
to ``z`` (or ``A`` to ``Z``) having
689-
values 10 to 35. The default *base* is 10. The allowed values are 0 and 2-36.
689+
values 10 to 35. The default *base* is 10. The allowed values are 0 and 2--36.
690690
Base-2, -8, and -16 literals can be optionally prefixed with ``0b``/``0B``,
691691
``0o``/``0O``, or ``0x``/``0X``, as with integer literals in code. Base 0
692692
means to interpret exactly as a code literal, so that the actual base is 2,

Doc/library/ipaddress.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ write code that handles both IP versions correctly.
9999
The following constitutes a valid IPv4 address:
100100

101101
1. A string in decimal-dot notation, consisting of four decimal integers in
102-
the inclusive range 0-255, separated by dots (e.g. ``192.168.0.1``). Each
102+
the inclusive range 0--255, separated by dots (e.g. ``192.168.0.1``). Each
103103
integer represents an octet (byte) in the address. Leading zeroes are
104104
tolerated only for values less than 8 (as there is no ambiguity
105105
between the decimal and octal interpretations of such strings).

Doc/library/json.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ Encoders and Decoders
338338

339339
If *strict* is false (``True`` is the default), then control characters
340340
will be allowed inside strings. Control characters in this context are
341-
those with character codes in the 0-31 range, including ``'\t'`` (tab),
341+
those with character codes in the 0--31 range, including ``'\t'`` (tab),
342342
``'\n'``, ``'\r'`` and ``'\0'``.
343343

344344
If the data being deserialized is not a valid JSON document, a

Doc/library/random.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ Alternative Generator:
266266

267267
M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623-dimensionally
268268
equidistributed uniform pseudorandom number generator", ACM Transactions on
269-
Modeling and Computer Simulation Vol. 8, No. 1, January pp.3-30 1998.
269+
Modeling and Computer Simulation Vol. 8, No. 1, January pp.3--30 1998.
270270

271271

272272
`Complementary-Multiply-with-Carry recipe

Doc/library/statistics.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ However, for reading convenience, most of the examples show sorted sequences.
191191
52.5
192192

193193
In the following example, the data are rounded, so that each value represents
194-
the midpoint of data classes, e.g. 1 is the midpoint of the class 0.5-1.5, 2
195-
is the midpoint of 1.5-2.5, 3 is the midpoint of 2.5-3.5, etc. With the data
196-
given, the middle value falls somewhere in the class 3.5-4.5, and
194+
the midpoint of data classes, e.g. 1 is the midpoint of the class 0.5--1.5, 2
195+
is the midpoint of 1.5--2.5, 3 is the midpoint of 2.5--3.5, etc. With the data
196+
given, the middle value falls somewhere in the class 3.5--4.5, and
197197
interpolation is used to estimate it:
198198

199199
.. doctest::

Doc/library/sys.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ always available.
256256
(defaulting to zero), or another type of object. If it is an integer, zero
257257
is considered "successful termination" and any nonzero value is considered
258258
"abnormal termination" by shells and the like. Most systems require it to be
259-
in the range 0-127, and produce undefined results otherwise. Some systems
259+
in the range 0--127, and produce undefined results otherwise. Some systems
260260
have a convention for assigning specific meanings to specific exit codes, but
261261
these are generally underdeveloped; Unix programs generally use 2 for command
262262
line syntax errors and 1 for all other kind of errors. If another type of

Doc/whatsnew/2.1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ of the more notable changes are:
731731
...
732732

733733
For a fuller discussion of the line I/O changes, see the python-dev summary for
734-
January 1-15, 2001 at https://mail.python.org/pipermail/python-dev/2001-January/.
734+
January 1--15, 2001 at https://mail.python.org/pipermail/python-dev/2001-January/.
735735

736736
* A new method, :meth:`popitem`, was added to dictionaries to enable
737737
destructively iterating through the contents of a dictionary; this can be faster

Doc/whatsnew/2.7.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Some key consequences of the long-term significance of 2.7 are:
104104
when compared to earlier 2.x versions. Python 2.7 is currently expected to
105105
remain supported by the core development team (receiving security updates
106106
and other bug fixes) until at least 2020 (10 years after its initial
107-
release, compared to the more typical support period of 18-24 months).
107+
release, compared to the more typical support period of 18--24 months).
108108

109109
* As the Python 2.7 standard library ages, making effective use of the
110110
Python Package Index (either directly or via a redistributor) becomes
@@ -989,7 +989,7 @@ Several performance enhancements have been added:
989989
Gregory Smith; :issue:`1087418`).
990990

991991
* The implementation of ``%`` checks for the left-side operand being
992-
a Python string and special-cases it; this results in a 1-3%
992+
a Python string and special-cases it; this results in a 1--3%
993993
performance increase for applications that frequently use ``%``
994994
with strings, such as templating libraries.
995995
(Implemented by Collin Winter; :issue:`5176`.)

Doc/whatsnew/3.5.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2129,8 +2129,8 @@ Many operations on :class:`io.BytesIO` are now 50% to 100% faster.
21292129
(Contributed by Serhiy Storchaka in :issue:`15381` and David Wilson in
21302130
:issue:`22003`.)
21312131

2132-
The :func:`marshal.dumps` function is now faster: 65-85% with versions 3
2133-
and 4, 20-25% with versions 0 to 2 on typical data, and up to 5 times in
2132+
The :func:`marshal.dumps` function is now faster: 65--85% with versions 3
2133+
and 4, 20--25% with versions 0 to 2 on typical data, and up to 5 times in
21342134
best cases.
21352135
(Contributed by Serhiy Storchaka in :issue:`20416` and :issue:`23344`.)
21362136

0 commit comments

Comments
 (0)