]> granicus.if.org Git - python/commitdiff
Issue #28763: Use double hyphens (rendered as en-dashes) in numerical ranges
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 26 Nov 2016 11:43:39 +0000 (13:43 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Sat, 26 Nov 2016 11:43:39 +0000 (13:43 +0200)
in the documentation.

17 files changed:
Doc/faq/design.rst
Doc/faq/general.rst
Doc/howto/unicode.rst
Doc/howto/urllib2.rst
Doc/library/calendar.rst
Doc/library/cmath.rst
Doc/library/codecs.rst
Doc/library/curses.ascii.rst
Doc/library/curses.rst
Doc/library/functions.rst
Doc/library/json.rst
Doc/library/random.rst
Doc/library/sgmllib.rst
Doc/library/sys.rst
Doc/reference/datamodel.rst
Doc/whatsnew/2.1.rst
Doc/whatsnew/2.7.rst

index 1e523d40d1042237d4d565e5a3bc0eaa34f0e6cb..0a8cfdd25d13a4811274f561f31502a7c745525c 100644 (file)
@@ -31,7 +31,7 @@ least slightly uneasy when reading (or being required to write) another style.
 Many coding styles place begin/end brackets on a line by themselves.  This makes
 programs considerably longer and wastes valuable screen space, making it harder
 to get a good overview of a program.  Ideally, a function should fit on one
-screen (say, 20-30 lines).  20 lines of Python can do a lot more work than 20
+screen (say, 20--30 lines).  20 lines of Python can do a lot more work than 20
 lines of C.  This is not solely due to the lack of begin/end brackets -- the
 lack of declarations and the high-level data types are also responsible -- but
 the indentation-based syntax certainly helps.
index f88f1de04e10dfbc93c72cebd8c2791cb52e2b1e..2de378d324aa78956eb25b83fbb12cb09af16242 100644 (file)
@@ -252,7 +252,7 @@ outdated.
 
     Guido van Rossum and Jelke de Boer, "Interactively Testing Remote Servers
     Using the Python Programming Language", CWI Quarterly, Volume 4, Issue 4
-    (December 1991), Amsterdam, pp 283-303.
+    (December 1991), Amsterdam, pp 283--303.
 
 
 Are there any books on Python?
index b94e5b5636203b6632c0214f5ace4a742639675a..bf7ebffc1d7704f5da1b213672f61918fd5c6f82 100644 (file)
@@ -42,14 +42,14 @@ In the 1980s, almost all personal computers were 8-bit, meaning that bytes could
 hold values ranging from 0 to 255.  ASCII codes only went up to 127, so some
 machines assigned values between 128 and 255 to accented characters.  Different
 machines had different codes, however, which led to problems exchanging files.
-Eventually various commonly used sets of values for the 128-255 range emerged.
+Eventually various commonly used sets of values for the 128--255 range emerged.
 Some were true standards, defined by the International Standards Organization,
 and some were **de facto** conventions that were invented by one company or
 another and managed to catch on.
 
 255 characters aren't very many.  For example, you can't fit both the accented
 characters used in Western Europe and the Cyrillic alphabet used for Russian
-into the 128-255 range because there are more than 128 such characters.
+into the 128--255 range because there are more than 128 such characters.
 
 You could write files using different codes (all your Russian files in a coding
 system called KOI8, all your French files in a different coding system called
@@ -62,7 +62,7 @@ bits means you have 2^16 = 65,536 distinct values available, making it possible
 to represent many different characters from many different alphabets; an initial
 goal was to have Unicode contain the alphabets for every single human language.
 It turns out that even 16 bits isn't enough to meet that goal, and the modern
-Unicode specification uses a wider range of codes, 0-1,114,111 (0x10ffff in
+Unicode specification uses a wider range of codes, 0--1,114,111 (0x10ffff in
 base-16).
 
 There's a related ISO standard, ISO 10646.  Unicode and ISO 10646 were
@@ -116,7 +116,7 @@ Encodings
 
 To summarize the previous section: a Unicode string is a sequence of code
 points, which are numbers from 0 to 0x10ffff.  This sequence needs to be
-represented as a set of bytes (meaning, values from 0-255) in memory.  The rules
+represented as a set of bytes (meaning, values from 0--255) in memory.  The rules
 for translating a Unicode string into a sequence of bytes are called an
 **encoding**.
 
@@ -163,7 +163,7 @@ simple; for each code point:
    case.)
 
 Latin-1, also known as ISO-8859-1, is a similar encoding.  Unicode code points
-0-255 are identical to the Latin-1 values, so converting to this encoding simply
+0--255 are identical to the Latin-1 values, so converting to this encoding simply
 requires converting code points to byte values; if a code point larger than 255
 is encountered, the string can't be encoded into Latin-1.
 
index 5cf2c0ca2e4777896196d8a054403566b9d333b0..c5003809829e216c389b55742e2f6a0293b07018 100644 (file)
@@ -229,8 +229,8 @@ Error Codes
 ~~~~~~~~~~~
 
 Because the default handlers handle redirects (codes in the 300 range), and
-codes in the 100-299 range indicate success, you will usually only see error
-codes in the 400-599 range.
+codes in the 100--299 range indicate success, you will usually only see error
+codes in the 400--599 range.
 
 ``BaseHTTPServer.BaseHTTPRequestHandler.responses`` is a useful dictionary of
 response codes in that shows all the response codes used by RFC 2616. The
index a04505f9fa1da8330177212d24d043dd8ebe5ad1..9e02ad39d0bdd8b25b60a32d2fd854b19b62b66a 100644 (file)
@@ -48,7 +48,7 @@ it's the base calendar for all computations.
 
    .. method:: itermonthdates(year, month)
 
-      Return an iterator for the month *month* (1-12) in the year *year*. This
+      Return an iterator for the month *month* (1--12) in the year *year*. This
       iterator will return all days (as :class:`datetime.date` objects) for the
       month and all days before the start of the month or after the end of the
       month that are required to get a complete week.
index fffdc9fe06cd46a5cd9a1570dae91d1515d7b424..b80eaba104d5eb5e136995f2706c2e2f3f208677 100644 (file)
@@ -255,6 +255,6 @@ cuts for numerical purposes, a good reference should be the following:
 
    Kahan, W:  Branch cuts for complex elementary functions; or, Much ado about
    nothing's sign bit.  In Iserles, A., and Powell, M. (eds.), The state of the art
-   in numerical analysis. Clarendon Press (1987) pp165-211.
+   in numerical analysis. Clarendon Press (1987) pp165--211.
 
 
index 9d52fe1b5d170a2cdc7c5669745a851569cd695d..4fd0951e304a74855379a637b1ddc0aad5b76936 100644 (file)
@@ -796,8 +796,8 @@ and how these arrays are stored as bytes become an issue.  Transforming a
 unicode object into a sequence of bytes is called encoding and recreating the
 unicode object from the sequence of bytes is known as decoding.  There are many
 different methods for how this transformation can be done (these methods are
-also called encodings). The simplest method is to map the code points 0-255 to
-the bytes ``0x0``-``0xff``. This means that a unicode object that contains
+also called encodings). The simplest method is to map the code points 0--255 to
+the bytes ``0x0``--``0xff``. This means that a unicode object that contains
 code points above ``U+00FF`` can't be encoded with this method (which is called
 ``'latin-1'`` or ``'iso-8859-1'``). :func:`unicode.encode` will raise a
 :exc:`UnicodeEncodeError` that looks like this: ``UnicodeEncodeError: 'latin-1'
@@ -806,7 +806,7 @@ range(256)``.
 
 There's another group of encodings (the so called charmap encodings) that choose
 a different subset of all unicode code points and how these code points are
-mapped to the bytes ``0x0``-``0xff``. To see how this is done simply open
+mapped to the bytes ``0x0``--``0xff``. To see how this is done simply open
 e.g. :file:`encodings/cp1252.py` (which is an encoding that is used primarily on
 Windows). There's a string constant with 256 characters that shows you which
 character is mapped to which byte value.
index 4f4d9155be2ac7b997111fd51ac73f873d501e83..ec20f54da4a5fcc7a99da9f04726836b484dfe1c 100644 (file)
@@ -214,7 +214,7 @@ it returns a string.
 
    Return a string representation of the ASCII character *c*.  If *c* is printable,
    this string is the character itself.  If the character is a control character
-   (0x00-0x1f) the string consists of a caret (``'^'``) followed by the
+   (0x00--0x1f) the string consists of a caret (``'^'``) followed by the
    corresponding uppercase letter. If the character is an ASCII delete (0x7f) the
    string is ``'^?'``.  If the character has its meta bit (0x80) set, the meta bit
    is stripped, the preceding rules applied, and ``'!'`` prepended to the result.
index 43941d94f89429af1eaf73f3ad2fea31d3d3a97f..c70afe3c9c01039e6c6a951e909195527c1bce28 100644 (file)
@@ -316,7 +316,7 @@ The module :mod:`curses` defines the following functions:
    Return the name of the key numbered *k*.  The name of a key generating printable
    ASCII character is the key's character.  The name of a control-key combination
    is a two-character string consisting of a caret followed by the corresponding
-   printable ASCII character.  The name of an alt-key combination (128-255) is a
+   printable ASCII character.  The name of an alt-key combination (128--255) is a
    string consisting of the prefix 'M-' followed by the name of the corresponding
    ASCII character.
 
index 350bc710690ab6522562c113d60514753e18ad5f..f294b6eab20af31f676ad68809d4e3f314198538 100644 (file)
@@ -670,7 +670,7 @@ section.
    preceded by ``+`` or ``-`` (with no space in between) and surrounded by
    whitespace.  A base-n literal consists of the digits 0 to n-1, with ``a``
    to ``z`` (or ``A`` to ``Z``) having
-   values 10 to 35.  The default *base* is 10. The allowed values are 0 and 2-36.
+   values 10 to 35.  The default *base* is 10. The allowed values are 0 and 2--36.
    Base-2, -8, and -16 literals can be optionally prefixed with ``0b``/``0B``,
    ``0o``/``0O``/``0``, or ``0x``/``0X``, as with integer literals in code.
    Base 0 means to interpret the string exactly as an integer literal, so that
index 70defa24071efb00070db3510ce79c318949fb96..c4d5ee6ec175be2f936f38a43d9538990c0b203f 100644 (file)
@@ -350,7 +350,7 @@ Encoders and Decoders
 
    If *strict* is false (``True`` is the default), then control characters
    will be allowed inside strings.  Control characters in this context are
-   those with character codes in the 0-31 range, including ``'\t'`` (tab),
+   those with character codes in the 0--31 range, including ``'\t'`` (tab),
    ``'\n'``, ``'\r'`` and ``'\0'``.
 
    If the data being deserialized is not a valid JSON document, a
index c569fa1c3a10cf907741aea850a76f282ec73537..2a3c3af091f677b39280524cfecc579cb9cdd56f 100644 (file)
@@ -343,7 +343,7 @@ Examples of basic usage::
 
    M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623-dimensionally
    equidistributed uniform pseudorandom number generator", ACM Transactions on
-   Modeling and Computer Simulation Vol. 8, No. 1, January pp.3-30 1998.
+   Modeling and Computer Simulation Vol. 8, No. 1, January pp.3--30 1998.
 
    Wichmann, B. A. & Hill, I. D., "Algorithm AS 183: An efficient and portable
    pseudo-random number generator", Applied Statistics 31 (1982) 188-190.
index bffd535c566a0380e64d60d51177a98cad3641f7..1fc650c24430266f425b5a02b501102215f5b1d9 100644 (file)
@@ -143,7 +143,7 @@ A single exception is defined as well:
 
    Convert a character reference to a string, or ``None``.  *ref* is the reference
    passed in as a string.  In the base implementation, *ref* must be a decimal
-   number in the range 0-255.  It converts the code point found using the
+   number in the range 0--255.  It converts the code point found using the
    :meth:`convert_codepoint` method. If *ref* is invalid or out of range, this
    method returns ``None``.  This method is called by the default
    :meth:`handle_charref` implementation and by the attribute value parser.
index e1900c7232c01b6fdc11f11300fab2ac50e0a297..31e644e394781d3b3d9c57cbcf6c18403553547d 100644 (file)
@@ -231,7 +231,7 @@ always available.
    (defaulting to zero), or another type of object.  If it is an integer, zero
    is considered "successful termination" and any nonzero value is considered
    "abnormal termination" by shells and the like.  Most systems require it to be
-   in the range 0-127, and produce undefined results otherwise.  Some systems
+   in the range 0--127, and produce undefined results otherwise.  Some systems
    have a convention for assigning specific meanings to specific exit codes, but
    these are generally underdeveloped; Unix programs generally use 2 for command
    line syntax errors and 1 for all other kind of errors.  If another type of
index 81206ce2d3a8cae685fd019f374b528b0735361b..db2fa1762e5cda72c5b4a3ef83e5129cb39f33e1 100644 (file)
@@ -301,7 +301,7 @@ Sequences
          character is represented by a string of one item. Characters represent (at
          least) 8-bit bytes.  The built-in functions :func:`chr` and :func:`ord` convert
          between characters and nonnegative integers representing the byte values.  Bytes
-         with the values 0-127 usually represent the corresponding ASCII values, but the
+         with the values 0--127 usually represent the corresponding ASCII values, but the
          interpretation of values is up to the program.  The string data type is also
          used to represent arrays of bytes, e.g., to hold data read from a file.
 
index 43922fe4c2b018a17fbb15a4d3b202f65342564c..cf026e93b4693fb0750aa26f12d0ca9af95c6e47 100644 (file)
@@ -731,7 +731,7 @@ of the more notable changes are:
          ...
 
   For a fuller discussion of the line I/O changes, see the python-dev summary for
-  January 1-15, 2001 at https://mail.python.org/pipermail/python-dev/2001-January/.
+  January 1--15, 2001 at https://mail.python.org/pipermail/python-dev/2001-January/.
 
 * A new method, :meth:`popitem`, was added to dictionaries to enable
   destructively iterating through the contents of a dictionary; this can be faster
index 8af8c061e1d859c81564fdee0566b4ce8a3e7f70..24137a8aeb5165d6b8f1c113cde2a186b33d9e08 100644 (file)
@@ -104,7 +104,7 @@ Some key consequences of the long-term significance of 2.7 are:
   when compared to earlier 2.x versions. Python 2.7 is currently expected to
   remain supported by the core development team (receiving security updates
   and other bug fixes) until at least 2020 (10 years after its initial
-  release, compared to the more typical support period of 18-24 months).
+  release, compared to the more typical support period of 18--24 months).
 
 * As the Python 2.7 standard library ages, making effective use of the
   Python Package Index (either directly or via a redistributor) becomes
@@ -974,7 +974,7 @@ Several performance enhancements have been added:
   Gregory Smith; :issue:`1087418`).
 
 * The implementation of ``%`` checks for the left-side operand being
-  a Python string and special-cases it; this results in a 1-3%
+  a Python string and special-cases it; this results in a 1--3%
   performance increase for applications that frequently use ``%``
   with strings, such as templating libraries.
   (Implemented by Collin Winter; :issue:`5176`.)