From 6bb5807c8ce2a64ad26646017c98faef64416376 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 19 Oct 2019 10:36:27 -0700 Subject: [PATCH 01/17] math.perm() and math.comb() --- Doc/whatsnew/3.8.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index ed450051170a60..1a2fea8dcf5f75 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -807,6 +807,16 @@ numbers:: (Contributed by Pablo Galindo in :issue:`35606`.) +Added two new combinatoric functions :func:`math.perm` and :func:`math.comb`:: + + >>> math.perm(10, 3) # Permutations of 10 things taken 3 at a time + 720 + >>> math.comb(10, 3) # Combinations of 10 things taken 3 at a time + 120 + +(Contributed by Yash Aggarwal, Keller Fuchs, Serhiy Storchaka, and Raymond +Hettinger in ::`37128`, :issue:`37178`, and :issue:`35431`.) + Added new function :func:`math.isqrt` for computing integer square roots. (Contributed by Mark Dickinson in :issue:`36887`.) From 4a0e2edacff0facb1cba8947789cdc9174b0b33f Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 19 Oct 2019 11:40:05 -0700 Subject: [PATCH 02/17] math.isqrt() --- Doc/whatsnew/3.8.rst | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 1a2fea8dcf5f75..bb5edca2e4fdf1 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -815,9 +815,20 @@ Added two new combinatoric functions :func:`math.perm` and :func:`math.comb`:: 120 (Contributed by Yash Aggarwal, Keller Fuchs, Serhiy Storchaka, and Raymond -Hettinger in ::`37128`, :issue:`37178`, and :issue:`35431`.) +Hettinger in :issue:`37128`, :issue:`37178`, and :issue:`35431`.) + +Added a new function :func:`math.isqrt` for computing accurate integer square +roots without conversion to floating point. The new function supports +arbitrarily large integers. It is faster than ``floor(sqrt(n))`` but slower +than :func:`math.sqrt`:: + + >>> r = 650320427 + >>> s = r ** 2 + >>> isqrt(s - 1) # correct + 650320426 + >>> floor(sqrt(s - 1)) # incorrect + 650320427 -Added new function :func:`math.isqrt` for computing integer square roots. (Contributed by Mark Dickinson in :issue:`36887`.) The function :func:`math.factorial` no longer accepts arguments that are not From 0d1c4049bada2ed5fb8681684fa639330a0d7593 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 19 Oct 2019 14:41:28 -0700 Subject: [PATCH 03/17] Add singledispatchmethod() --- Doc/whatsnew/3.8.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index bb5edca2e4fdf1..664487aea270c0 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -700,6 +700,30 @@ cached for the life of the instance. :: (Contributed by Carl Meyer in :issue:`21145`) +Added a new :func:`functools.singledispatchmethod` decorator that converts +methods into :term:`generic functions ` using +:term:`single dispatch`:: + + from functools import singledispatchmethod + from contextlib import suppress + + class TaskManager: + + def __init__(self, tasks): + self.tasks = list(tasks) + + @singledispatchmethod + def discard(self, value): + with suppress(ValueError): + self.tasks.remove(value) + + @discard.register(list) + def _(self, tasks): + targets = set(tasks) + self.tasks = [x for x in self.tasks if x not in targets] + +(Contributed by Ethan Smith in :issue:`32380`) + gc -- From b7c64fd87f809b00063d1e1f3888b856284c0d8a Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 19 Oct 2019 15:06:55 -0700 Subject: [PATCH 04/17] itertools.accumulate() --- Doc/whatsnew/3.8.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 664487aea270c0..399a5827fe06f5 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -803,6 +803,19 @@ fails. The exception is ignored silently by default in release build. (Contributed by Victor Stinner in :issue:`18748`.) +itertools +--------- + +The :func:`itertools.accumulate` function added an option *initial* keyword +argument to specify an initial value:: + + >>> from itertools import accumulate + >>> list(accumulate([10, 5, 30, 15], initial=1000)) + [1000, 1010, 1015, 1045, 1060] + +(Contributed by Lisa Roach in :issue:`34659`.) + + json.tool --------- From d152ac4f654cbd023955e9d93ca119ae27989e78 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 19 Oct 2019 17:44:11 -0700 Subject: [PATCH 05/17] Optional headers for xmlrpc.client.ServerProxy --- Doc/whatsnew/3.8.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 399a5827fe06f5..a42017f245d017 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -1291,6 +1291,16 @@ them in the generated tree. (Contributed by Stefan Behnel in :issue:`36676` and :issue:`36673`.) +xmlprc +------ + +:class:`xmlrpc.client.ServerProxy` now supports an optional *headers* keyword +argument for a sequence of HTTP headers to be sent with each request. Among +other things, this makes it possible to upgrade from default basic +authentication to faster session authentication. +(Contributed by Cédric Krier in :issue:`35153`.) + + Optimizations ============= From 796d4ecd5cdf6b56b43faf8ce61512865a94f31d Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 19 Oct 2019 18:55:03 -0700 Subject: [PATCH 06/17] IDLE non-BMP characters --- Doc/whatsnew/3.8.rst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index a42017f245d017..63ae6a09962bca 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -751,7 +751,7 @@ for certain types of invalid or corrupt gzip files. :issue:`6584`.) -idlelib and IDLE +IDLE and idlelib ---------------- Output over N lines (50 by default) is squeezed down to a button. @@ -767,12 +767,19 @@ They also re-appear in the box for the next customized run. One can also suppress the normal Shell main module restart. (Contributed by Cheryl Sabella, Terry Jan Reedy, and others in :issue:`5680` and :issue:`37627`.) -Add optional line numbers for IDLE editor windows. Windows +Added optional line numbers for IDLE editor windows. Windows open without line numbers unless set otherwise in the General tab of the configuration dialog. Line numbers for an existing window are shown and hidden in the Options menu. (Contributed by Tal Einat and Saimadhav Heblikar in :issue:`17535`.) +OS native encoding is now used for converting between Python strings and Tcl +objects. This allows IDLE to work with emoji and other non-BMP characters. +These characters can be displayed or copied and pasted to or from the +clipboard. Converting strings from Tcl to Python and back now never fails. +(Many people worked on this for eight years but the problem was finally +solved by Serhiy Storchaka in :issue:`13153`.) + The changes above have been backported to 3.7 maintenance releases. From 32f97b07755221e7177261b3f2c7e8bfb47fe0fc Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 19 Oct 2019 20:34:16 -0700 Subject: [PATCH 07/17] import collections.abc directly --- Doc/whatsnew/3.8.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 63ae6a09962bca..82e2f6e34e76ad 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -1587,6 +1587,11 @@ API and Feature Removals The following features and APIs have been removed from Python 3.8: +* Starting with Python 3.3, importing ABCs from :mod:`collections` was + deprecated, and importing should be done from :mod:`collections.abc`. Being + able to import from collections was marked for removal in 3.8, but has been + delayed to 3.9. (See :issue:`36952`.) + * The :mod:`macpath` module, deprecated in Python 3.7, has been removed. (Contributed by Victor Stinner in :issue:`35471`.) From b458507e32b8c690fe14d0ab4c0eb11fa3ab7e72 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 19 Oct 2019 20:50:42 -0700 Subject: [PATCH 08/17] @coroutine is deprecated --- Doc/whatsnew/3.8.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 82e2f6e34e76ad..48f954caab66ab 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -1531,6 +1531,11 @@ Deprecated constant nodes. (Contributed by Serhiy Storchaka in :issue:`36917`.) +* The :func:`asyncio.coroutine` :term:`decorator` is deprecated and will be + removed in version 3.10. Instead of ``@asyncio.coroutine``, use + :keyword:`async def` instead. + (Contributed by Andrew Svetlov in :issue:`36921`.) + * The following functions and methods are deprecated in the :mod:`gettext` module: :func:`~gettext.lgettext`, :func:`~gettext.ldgettext`, :func:`~gettext.lngettext` and :func:`~gettext.ldngettext`. From 638a2c978233e13058f6c7e8e8b07b9debcd4e9a Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 19 Oct 2019 21:26:34 -0700 Subject: [PATCH 09/17] pprint.pp() --- Doc/whatsnew/3.8.rst | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 48f954caab66ab..b0c9b3553a4ed5 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -992,6 +992,32 @@ NSKeyedArchiver-encoded binary plists. (Contributed by Jon Janzen in :issue:`26707`.) +pprint +------ + +The :mod:`pprint` module added a *sort_dicts* parameter to several functions. +By default, those functions continue to sort dictionaries before rendering or +printing. However if *sort_dicts* is set to *False*, the dictionaries retain +the order that keys were inserted. This can be useful for comparison to JSON +inputs during debugging. + +In addition, there is a convenience new function, :func:`pprint.pp` that is +like :func:`pprint.pprint` but with *sort_dicts* defaulting to *False*:: + + >>> from pprint import pprint, pp + >>> d = dict(source='input.txt', operation='filter', destination='output.txt') + >>> pp(d, width=40) # Original order + {'source': 'input.txt', + 'operation': 'filter', + 'destination': 'output.txt'} + >>> pprint(d, width=40) # Keys sorted alphabetically + {'destination': 'output.txt', + 'operation': 'filter', + 'source': 'input.txt'} + +(Contributed by Rémi Lapeyre in :issue:`30670`.) + + py_compile ---------- From 37e24a387a371dcd9b6f75441e456fd82ad003be Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 19 Oct 2019 22:44:48 -0700 Subject: [PATCH 10/17] New options for object.__reduce__() --- Doc/whatsnew/3.8.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index b0c9b3553a4ed5..8360f49cb22d5f 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -529,6 +529,13 @@ Other Language Changes (Contributed by Jörn Heissler in :issue:`35224`.) +* The :meth:`object.__reduce__` method can now return a tuple from two to + six elements long. Formerly, five was the limit. The new, optional sixth + element is a callable with a ``(obj, state)`` signature. This allows the + direct control over the state-updating behavior of a specific object. If + not *None*, this callable will have priority over the object's + :meth:`~__setstate__` method. + (Contributed by Pierre Glaser is :issue:`35900`.) New Modules =========== From a6a62ad29c1071405c427717a03ad093d7964103 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 19 Oct 2019 23:09:41 -0700 Subject: [PATCH 11/17] DictReader no longer returns OrderedDicts --- Doc/whatsnew/3.8.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 8360f49cb22d5f..04ec8d17c6dc8b 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -645,6 +645,15 @@ to cast the result to the desired type: ``OrderedDict(nt._asdict())``. (Contributed by Raymond Hettinger in :issue:`35864`.) +csv +--- + +The :class:`csv.DictReader` now returns instances of :class:`dict` instead of +a :class:`collections.OrderedDict`. The tool is now faster and uses less +memory while still preserving the field order. +(Contributed by Michael Seek in :issue:`34003`.) + + curses ------- From 2a895b8c8ae48aeaada81e372b14a19396b257f1 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 19 Oct 2019 23:22:05 -0700 Subject: [PATCH 12/17] "force" option for logging.basicConfig() --- Doc/whatsnew/3.8.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 04ec8d17c6dc8b..2df4ed60d97bd7 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -846,6 +846,24 @@ Add option ``--json-lines`` to parse every input line as separate JSON object. (Contributed by Weipeng Hong in :issue:`31553`.) +logging +------- + +Added a *force* keyword argument to :func:`logging.basicConfig()` +When set to *True*, any existing handlers attached +to the root logger are removed and closed before carrying out the +configuration specified by the other arguments. + +This solves a long standing problem. Once a logger or *basicConfig()* had +been called, subsequent calls to *basicConfig()* were silently ignored. +This made it difficult to update, experiment with, or teach the various +logging configuration options using the interactive prompt or a Jupyter +notebook. + +(Suggested by Raymond Hettinger, implemented by Dong-hee Na, and +reviewed by Vinay Sajip in :issue:`33897`.) + + math ---- From ad4249d7d288b0255a34a5e5b5ee295d20bdd5f4 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 19 Oct 2019 23:33:43 -0700 Subject: [PATCH 13/17] Fix spelling --- Doc/whatsnew/3.8.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 2df4ed60d97bd7..9116385dcdcf1e 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -1358,7 +1358,7 @@ them in the generated tree. (Contributed by Stefan Behnel in :issue:`36676` and :issue:`36673`.) -xmlprc +xmlrpc ------ :class:`xmlrpc.client.ServerProxy` now supports an optional *headers* keyword From 019f3b2d27c5f01ba99c5f25b46e7c68f58ab295 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sun, 20 Oct 2019 00:02:04 -0700 Subject: [PATCH 14/17] cProfile context manager --- Doc/whatsnew/3.8.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 9116385dcdcf1e..4db38265ef4285 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -645,6 +645,21 @@ to cast the result to the desired type: ``OrderedDict(nt._asdict())``. (Contributed by Raymond Hettinger in :issue:`35864`.) +cProfile +-------- + +The :class:`cProfile.Profile ` class can now be used as a context manager. +Profile a block of code by running:: + + import cProfile + + with cProfile.Profile() as profiler: + # code to be profiled + ... + +(Contributed by Scott Sanderson in :issue:`29235`.) + + csv --- From e3a2fc029a95f9f7cd8be44252d02073fc399dde Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sun, 20 Oct 2019 00:55:42 -0700 Subject: [PATCH 15/17] Various markup/grammar fixes from Kyle Stanley. Other minor fixes as well. Also, dedup the __reduce__ entry. --- Doc/whatsnew/3.8.rst | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 4db38265ef4285..a291b364889038 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -445,7 +445,7 @@ Other Language Changes an instance of the subclass, rather than the base class. This also affects the return type of operations whose implementation (directly or indirectly) uses :class:`datetime.timedelta` arithmetic, such as - :meth:`datetime.datetime.astimezone`. + :meth:`~datetime.datetime.astimezone`. (Contributed by Paul Ganssle in :issue:`32417`.) * When the Python interpreter is interrupted by Ctrl-C (SIGINT) and the @@ -535,7 +535,7 @@ Other Language Changes direct control over the state-updating behavior of a specific object. If not *None*, this callable will have priority over the object's :meth:`~__setstate__` method. - (Contributed by Pierre Glaser is :issue:`35900`.) + (Contributed by Pierre Glaser and Olivier Grisel in :issue:`35900`.) New Modules =========== @@ -586,8 +586,8 @@ The :func:`ast.parse` function has some new flags: comments" (returned for function definition AST nodes); * ``feature_version=(3, N)`` allows specifying an earlier Python 3 - version. (For example, ``feature_version=(3, 4)`` will treat - ``async`` and ``await`` as non-reserved words.) + version. For example, ``feature_version=(3, 4)`` will treat + :keyword:`async` and :keyword:`await` as non-reserved words. (Contributed by Guido van Rossum in :issue:`35766`.) @@ -637,11 +637,12 @@ marked with the ``CO_COROUTINE`` flag may then be returned. collections ----------- -The :meth:`_asdict()` method for :func:`collections.namedtuple` now returns -a :class:`dict` instead of a :class:`collections.OrderedDict`. This works because -regular dicts have guaranteed ordering since Python 3.7. If the extra -features of :class:`OrderedDict` are required, the suggested remediation is -to cast the result to the desired type: ``OrderedDict(nt._asdict())``. +The :meth:`~collections.somenamedtuple._asdict` method for +:func:`collections.namedtuple` now returns a :class:`dict` instead of a +:class:`collections.OrderedDict`. This works because regular dicts have +guaranteed ordering since Python 3.7. If the extra features of +:class:`OrderedDict` are required, the suggested remediation is to cast the +result to the desired type: ``OrderedDict(nt._asdict())``. (Contributed by Raymond Hettinger in :issue:`35864`.) @@ -857,7 +858,7 @@ argument to specify an initial value:: json.tool --------- -Add option ``--json-lines`` to parse every input line as separate JSON object. +Add option ``--json-lines`` to parse every input line as a separate JSON object. (Contributed by Weipeng Hong in :issue:`31553`.) @@ -1022,11 +1023,6 @@ to a path. pickle ------ -Reduction methods can now include a 6th item in the tuple they return. This -item should specify a custom state-setting method that's called instead of the -regular ``__setstate__`` method. -(Contributed by Pierre Glaser and Olivier Grisel in :issue:`35900`.) - :mod:`pickle` extensions subclassing the C-optimized :class:`~pickle.Pickler` can now override the pickling logic of functions and classes by defining the special :meth:`~pickle.Pickler.reducer_override` method. @@ -1113,8 +1109,8 @@ The :func:`socket.if_nameindex()`, :func:`socket.if_nametoindex()`, and ssl --- -Added :attr:`ssl.SSLContext.post_handshake_auth` to enable and -:meth:`ssl.SSLSocket.verify_client_post_handshake` to initiate TLS 1.3 +Added :attr:`~ssl.SSLContext.post_handshake_auth` to enable and +:meth:`~ssl.SSLSocket.verify_client_post_handshake` to initiate TLS 1.3 post-handshake authentication. (Contributed by Christian Heimes in :issue:`34670`.) @@ -1292,8 +1288,9 @@ the string. (Contributed by Max Belanger, David Euresti, and Greg Price in unittest -------- -Added :class:`AsyncMock` to support an asynchronous version of :class:`Mock`. -Appropriate new assert functions for testing have been added as well. +Added :class:`~unittest.mock.AsyncMock` to support an asynchronous version of +:class:`~unittest.mock.Mock`. Appropriate new assert functions for testing +have been added as well. (Contributed by Lisa Roach in :issue:`26467`). Added :func:`~unittest.addModuleCleanup()` and @@ -1790,7 +1787,7 @@ Changes in the Python API (Contributed by Eric Snow in :issue:`34651`, modified by Christian Heimes in :issue:`37951`.) -* The :meth:`imap.IMAP4.logout` method no longer ignores silently arbitrary +* The :meth:`imap.IMAP4.logout` method no longer silently ignores arbitrary exceptions. (Contributed by Victor Stinner in :issue:`36348`.) @@ -1845,7 +1842,7 @@ Changes in the Python API * The ``PyGC_Head`` struct has changed completely. All code that touched the struct member should be rewritten. (See :issue:`33597`.) -* The ``PyInterpreterState`` struct has been moved into the "internal" +* The c:type:`PyInterpreterState` struct has been moved into the "internal" header files (specifically Include/internal/pycore_pystate.h). An opaque ``PyInterpreterState`` is still available as part of the public API (and stable ABI). The docs indicate that none of the struct's From 0fef22c5934762985ffe94e25159c972692d7cd6 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sun, 20 Oct 2019 01:33:20 -0700 Subject: [PATCH 16/17] Fix markup --- Doc/whatsnew/3.8.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index a291b364889038..4215c7fb34fb3a 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -1842,7 +1842,7 @@ Changes in the Python API * The ``PyGC_Head`` struct has changed completely. All code that touched the struct member should be rewritten. (See :issue:`33597`.) -* The c:type:`PyInterpreterState` struct has been moved into the "internal" +* The :c:type:`PyInterpreterState` struct has been moved into the "internal" header files (specifically Include/internal/pycore_pystate.h). An opaque ``PyInterpreterState`` is still available as part of the public API (and stable ABI). The docs indicate that none of the struct's From b4fd853998348d85721f66d3c2a234712b079bf2 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sun, 20 Oct 2019 01:48:08 -0700 Subject: [PATCH 17/17] Fix grammar nits found by MS Word --- Doc/whatsnew/3.8.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 4215c7fb34fb3a..db40ce756287fa 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -355,8 +355,8 @@ It is meant to formalize existing optimizations which were already done for various classes. Any extension type implementing a callable can use this protocol. -This is currently provisional, -the aim is to make it fully public in Python 3.9. +This is currently provisional. +The aim is to make it fully public in Python 3.9. See :pep:`590` for a full description. @@ -870,7 +870,7 @@ When set to *True*, any existing handlers attached to the root logger are removed and closed before carrying out the configuration specified by the other arguments. -This solves a long standing problem. Once a logger or *basicConfig()* had +This solves a long-standing problem. Once a logger or *basicConfig()* had been called, subsequent calls to *basicConfig()* were silently ignored. This made it difficult to update, experiment with, or teach the various logging configuration options using the interactive prompt or a Jupyter @@ -1042,7 +1042,7 @@ pprint The :mod:`pprint` module added a *sort_dicts* parameter to several functions. By default, those functions continue to sort dictionaries before rendering or -printing. However if *sort_dicts* is set to *False*, the dictionaries retain +printing. However, if *sort_dicts* is set to *False*, the dictionaries retain the order that keys were inserted. This can be useful for comparison to JSON inputs during debugging. @@ -1654,7 +1654,7 @@ Deprecated :class:`multiprocessing.managers.SharedMemoryServer`. - *obj* in :func:`weakref.finalize`. - In future releases of Python they will be :ref:`positional-only + In future releases of Python, they will be :ref:`positional-only `. (Contributed by Serhiy Storchaka in :issue:`36492`.)