From bdfe8788e50bd27eaae33c74e699ed3620ebb304 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Wed, 24 May 2023 18:27:40 -0500 Subject: [PATCH 1/7] Misc updates to Whatsnew 3.12 --- Doc/whatsnew/3.12.rst | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 8de6cf4da88acd..318cd14c240274 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -341,7 +341,11 @@ Other Language Changes (Contributed by Nikita Sobolev in :gh:`100581`.) * :class:`slice` objects are now hashable, allowing them to be used as dict keys and - set items. (Contributed by Will Bradshaw and Furkan Onder in :gh:`101264`.) + set items. (Contributed by Will Bradshaw, Furkan Onder, and Raymond Hettinger in :gh:`101264`.) + +* :func:`sum` now uses Neumaier summation to improve accuracy when summing + floats or mixed ints and floats. + (Contributed by Raymond Hettinger in :gh:`100425`.) * Exceptions raised in a typeobject's ``__set_name__`` method are no longer wrapped by a :exc:`RuntimeError`. Context information is added to the @@ -499,6 +503,10 @@ math * Added :func:`math.sumprod` for computing a sum of products. (Contributed by Raymond Hettinger in :gh:`100485`.) +* Extended :func:`math.nextafter` to include a `steps` argument + for moving up or down multiple steps at a time. + (By Matthias Goergens, Mark Dickinson, and Raymond Hettingerin :gh:`94906`.) + os -- @@ -541,6 +549,15 @@ pdb value. (Contributed by Tian Gao in :gh:`103693`.) +random +------ + +* Added :func:`random.binomialvariate`. + (Contributed by Raymond Hettinger in :gh:`81620`.) + +* Added a default parameter of `lamb=1.0` to :func:`random.expovariate`. + (Contributed by Raymond Hettinger in :gh:`100234`.) + shutil ------ @@ -594,6 +611,13 @@ sqlite3 to make configuration changes to a database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.) +statistics +---------- + +* Extended :func:`statistics.correlation` to include as a `ranked` method + for computing the Spearman correlation of ranked data. + (Contributed by Raymond Hettinger in :gh:`95861`.) + threading --------- From 4b83beab4b2dd22a7ec8bb8228c426d71b4a214a Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Wed, 24 May 2023 20:22:58 -0500 Subject: [PATCH 2/7] Fix typo --- Doc/whatsnew/3.12.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 318cd14c240274..39e1d7b2026c5e 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -505,7 +505,7 @@ math * Extended :func:`math.nextafter` to include a `steps` argument for moving up or down multiple steps at a time. - (By Matthias Goergens, Mark Dickinson, and Raymond Hettingerin :gh:`94906`.) + (By Matthias Goergens, Mark Dickinson, and Raymond Hettinger in :gh:`94906`.) os -- From 7faffc09f660ccd5c84e4a1a5c36cccc439bb83b Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Wed, 24 May 2023 20:30:59 -0500 Subject: [PATCH 3/7] Py3.13 pending removal: classmethod descriptor chaining. --- Doc/whatsnew/3.12.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 39e1d7b2026c5e..8a8d9ef20d4d41 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -939,6 +939,7 @@ APIs: * :func:`!unittest.makeSuite` (:gh:`50096`) * :func:`!unittest.getTestCaseNames` (:gh:`50096`) * :class:`!webbrowser.MacOSX` (:gh:`86421`) +* :class:`classmethod` descriptor chaining (:gh:`gh-89519`) Pending Removal in Python 3.14 ------------------------------ From fc2c75e9ce912291296139e9fd2d6015467cb4f7 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Wed, 24 May 2023 20:38:19 -0500 Subject: [PATCH 4/7] json.AttrDict --- Doc/whatsnew/3.12.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 8a8d9ef20d4d41..11107f9d490913 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -497,6 +497,14 @@ itertools tuples where the last batch may be shorter than the rest. (Contributed by Raymond Hettinger in :gh:`98363`.) +json +---- + +* Added :class:`json.AttrDict` for use with `object_hook` in :func:`json.load` + or :func:`json.loads`. This is a subclass of :class:`dict` that also supports + attribute style dotted access. + (Contributed by Raymond Hettinger in :gh:`96145`.) + math ---- From e68d66344374624a75d93aa5500499dc3635a7e0 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Wed, 24 May 2023 20:39:40 -0500 Subject: [PATCH 5/7] Fix typos --- Doc/library/json.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/json.rst b/Doc/library/json.rst index 00f585124a86b3..a752efd7ef2292 100644 --- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -552,10 +552,10 @@ Exceptions AttrDict(mapping, **kwargs) AttrDict(iterable, **kwargs) - Subclass of :class:`dict` object that also supports attribute style dotted access. + Subclass of :class:`dict` that also supports attribute style dotted access. This class is intended for use with the :attr:`object_hook` in - :func:`json.load` and :func:`json.loads`:: + :func:`json.load` and :func:`json.loads`: .. doctest:: From a72c871f3f300f3950d8d115c744de9ce21af9ad Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Wed, 24 May 2023 20:44:39 -0500 Subject: [PATCH 6/7] Fix markup --- Doc/whatsnew/3.12.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 11107f9d490913..5bc85887ec05dd 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -500,7 +500,7 @@ itertools json ---- -* Added :class:`json.AttrDict` for use with `object_hook` in :func:`json.load` +* Added :class:`json.AttrDict` for use with ``object_hook`` in :func:`json.load` or :func:`json.loads`. This is a subclass of :class:`dict` that also supports attribute style dotted access. (Contributed by Raymond Hettinger in :gh:`96145`.) @@ -511,7 +511,7 @@ math * Added :func:`math.sumprod` for computing a sum of products. (Contributed by Raymond Hettinger in :gh:`100485`.) -* Extended :func:`math.nextafter` to include a `steps` argument +* Extended :func:`math.nextafter` to include a *steps* argument for moving up or down multiple steps at a time. (By Matthias Goergens, Mark Dickinson, and Raymond Hettinger in :gh:`94906`.) @@ -563,7 +563,7 @@ random * Added :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :gh:`81620`.) -* Added a default parameter of `lamb=1.0` to :func:`random.expovariate`. +* Added a default of ``lamb=1.0`` to :func:`random.expovariate`. (Contributed by Raymond Hettinger in :gh:`100234`.) shutil @@ -622,7 +622,7 @@ sqlite3 statistics ---------- -* Extended :func:`statistics.correlation` to include as a `ranked` method +* Extended :func:`statistics.correlation` to include as a ``ranked`` method for computing the Spearman correlation of ranked data. (Contributed by Raymond Hettinger in :gh:`95861`.) From d931beca2d402efa0ef5da9e909c987388a2d4ee Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Wed, 24 May 2023 20:50:14 -0500 Subject: [PATCH 7/7] Fix markup --- Doc/whatsnew/3.12.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 91297b45b3bd1e..0e4ccab14bafcf 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -947,7 +947,7 @@ APIs: * :func:`!unittest.makeSuite` (:gh:`50096`) * :func:`!unittest.getTestCaseNames` (:gh:`50096`) * :class:`!webbrowser.MacOSX` (:gh:`86421`) -* :class:`classmethod` descriptor chaining (:gh:`gh-89519`) +* :class:`classmethod` descriptor chaining (:gh:`89519`) Pending Removal in Python 3.14 ------------------------------