From efc910647d47eb2d8ada6ab915392380e07c4b7c Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Fri, 12 May 2023 14:59:09 +0100 Subject: [PATCH 1/2] gh-102500: Fixup some docs issues following ByteString deprecation --- Doc/library/collections.abc.rst | 4 +++- Doc/whatsnew/3.12.rst | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Doc/library/collections.abc.rst b/Doc/library/collections.abc.rst index 43a3286ba832cf..9a3e4e44e7664b 100644 --- a/Doc/library/collections.abc.rst +++ b/Doc/library/collections.abc.rst @@ -14,7 +14,9 @@ .. testsetup:: * - from collections.abc import * + import warnings + with warnings.catch_warnings(action='ignore', category=DeprecationWarning): + from collections.abc import * import itertools __name__ = '' diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index eb13d4bf031c95..546c7147bb3b27 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -831,6 +831,9 @@ Pending Removal in Python 3.14 For use in typing, prefer a union, like ``bytes | bytearray``, or :class:`collections.abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.) +* :class:`typing.ByteString`, deprecated since Python 3.9, now causes an + :exc:`DeprecationWarning` to be emitted when it is used or accessed. + * Creating immutable types (:data:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable bases using the C API. From 937ce5eef3c1d25976243e1e8a57af8f2daacb9b Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Fri, 12 May 2023 15:28:42 +0100 Subject: [PATCH 2/2] Update Doc/library/collections.abc.rst Co-authored-by: Jelle Zijlstra --- Doc/library/collections.abc.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/library/collections.abc.rst b/Doc/library/collections.abc.rst index 9a3e4e44e7664b..158f4851634652 100644 --- a/Doc/library/collections.abc.rst +++ b/Doc/library/collections.abc.rst @@ -15,6 +15,7 @@ .. testsetup:: * import warnings + # Ignore warning when ByteString is imported with warnings.catch_warnings(action='ignore', category=DeprecationWarning): from collections.abc import * import itertools pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy