From 5764ce5a5026b47105b754f2deb45658b7e21c4d Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 28 Apr 2025 15:55:39 +0300 Subject: [PATCH 1/4] Include pending 3.18 C API removals in indexes --- Doc/deprecations/index.rst | 2 ++ Doc/whatsnew/3.13.rst | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Doc/deprecations/index.rst b/Doc/deprecations/index.rst index bac6e3f18d4594..44fb7c5e831608 100644 --- a/Doc/deprecations/index.rst +++ b/Doc/deprecations/index.rst @@ -12,4 +12,6 @@ C API deprecations .. include:: c-api-pending-removal-in-3.15.rst +.. include:: c-api-pending-removal-in-3.18.rst + .. include:: c-api-pending-removal-in-future.rst diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 2090759d3c4fde..18573b8346e9ce 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -2529,6 +2529,8 @@ Deprecated C APIs .. include:: ../deprecations/c-api-pending-removal-in-3.15.rst +.. include:: ../deprecations/c-api-pending-removal-in-3.18.rst + .. include:: ../deprecations/c-api-pending-removal-in-future.rst .. _pythoncapi-compat project: https://github.com/python/pythoncapi-compat/ From 82d520f29b9df654b96c14a363db8321cb65a977 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 28 Apr 2025 15:56:51 +0300 Subject: [PATCH 2/4] Add typing to 3.17 pending removals and include in indexes --- Doc/deprecations/index.rst | 2 ++ Doc/deprecations/pending-removal-in-3.17.rst | 13 +++++++++++++ Doc/whatsnew/3.12.rst | 2 ++ Doc/whatsnew/3.13.rst | 2 ++ Doc/whatsnew/3.14.rst | 2 ++ 5 files changed, 21 insertions(+) create mode 100644 Doc/deprecations/pending-removal-in-3.17.rst diff --git a/Doc/deprecations/index.rst b/Doc/deprecations/index.rst index 44fb7c5e831608..bb78f7b36071b8 100644 --- a/Doc/deprecations/index.rst +++ b/Doc/deprecations/index.rst @@ -5,6 +5,8 @@ Deprecations .. include:: pending-removal-in-3.16.rst +.. include:: pending-removal-in-3.17.rst + .. include:: pending-removal-in-future.rst C API deprecations diff --git a/Doc/deprecations/pending-removal-in-3.17.rst b/Doc/deprecations/pending-removal-in-3.17.rst new file mode 100644 index 00000000000000..cf4f46d27af18b --- /dev/null +++ b/Doc/deprecations/pending-removal-in-3.17.rst @@ -0,0 +1,13 @@ +Pending removal in Python 3.17 +------------------------------ + +* :mod:`typing`: + + - Before Python 3.14, old-style unions were implemented using the private class + ``typing._UnionGenericAlias``. This class is no longer needed for the implementation, + but it has been retained for backward compatibility, with removal scheduled for Python + 3.17. Users should use documented introspection helpers like :func:`typing.get_origin` + and :func:`typing.get_args` instead of relying on private implementation details. + - It is now possible to use :class:`typing.Union` itself in :func:`isinstance` checks. + For example, ``isinstance(int | str, typing.Union)`` will return ``True``; previously + this raised :exc:`TypeError`. diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index afbc7a1c16f2de..a65f59c0a72315 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -1347,6 +1347,8 @@ Deprecated .. include:: ../deprecations/pending-removal-in-3.16.rst +.. include:: ../deprecations/pending-removal-in-3.17.rst + .. include:: ../deprecations/pending-removal-in-future.rst .. _whatsnew312-removed: diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 18573b8346e9ce..e20e49325c01d5 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -2009,6 +2009,8 @@ New Deprecations .. include:: ../deprecations/pending-removal-in-3.16.rst +.. include:: ../deprecations/pending-removal-in-3.17.rst + .. include:: ../deprecations/pending-removal-in-future.rst CPython Bytecode Changes diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst index 13ac8d63aef33c..e8139604609236 100644 --- a/Doc/whatsnew/3.14.rst +++ b/Doc/whatsnew/3.14.rst @@ -1626,6 +1626,8 @@ Deprecated .. include:: ../deprecations/pending-removal-in-3.16.rst +.. include:: ../deprecations/pending-removal-in-3.17.rst + .. include:: ../deprecations/pending-removal-in-future.rst Removed From 2740105a4718c520fef0ab3198a7148d04dff686 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 28 Apr 2025 15:57:45 +0300 Subject: [PATCH 3/4] Add logging to 3.16 pending removals --- Doc/deprecations/pending-removal-in-3.16.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Doc/deprecations/pending-removal-in-3.16.rst b/Doc/deprecations/pending-removal-in-3.16.rst index acb53198bdc07e..6a9e7e35cb4fee 100644 --- a/Doc/deprecations/pending-removal-in-3.16.rst +++ b/Doc/deprecations/pending-removal-in-3.16.rst @@ -61,6 +61,12 @@ Pending removal in Python 3.16 * Calling the Python implementation of :func:`functools.reduce` with *function* or *sequence* as keyword arguments has been deprecated since Python 3.14. +* :mod:`logging`: + + Support for custom logging handlers with the *strm* argument is deprecated + and scheduled for removal in Python 3.16. Define handlers with the *stream* + argument instead. (Contributed by Mariusz Felisiak in :gh:`115032`.) + * :mod:`shutil`: * The :class:`!ExecError` exception From 09ee00d803f295e666f929c288d3c5ac3755faaf Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Thu, 1 May 2025 15:19:33 +0300 Subject: [PATCH 4/4] Remove non-deprecation Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- Doc/deprecations/pending-removal-in-3.17.rst | 3 --- 1 file changed, 3 deletions(-) diff --git a/Doc/deprecations/pending-removal-in-3.17.rst b/Doc/deprecations/pending-removal-in-3.17.rst index cf4f46d27af18b..370b98307e5228 100644 --- a/Doc/deprecations/pending-removal-in-3.17.rst +++ b/Doc/deprecations/pending-removal-in-3.17.rst @@ -8,6 +8,3 @@ Pending removal in Python 3.17 but it has been retained for backward compatibility, with removal scheduled for Python 3.17. Users should use documented introspection helpers like :func:`typing.get_origin` and :func:`typing.get_args` instead of relying on private implementation details. - - It is now possible to use :class:`typing.Union` itself in :func:`isinstance` checks. - For example, ``isinstance(int | str, typing.Union)`` will return ``True``; previously - this raised :exc:`TypeError`.