From: Alex Waygood Date: Fri, 12 May 2023 14:38:35 +0000 (+0100) Subject: gh-91896: Fixup some docs issues following ByteString deprecation (#104422) X-Git-Tag: v3.12.0b1~144 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ce4eecf989e23fa26c033de78f1ca8b035a979cb;p=thirdparty%2FPython%2Fcpython.git gh-91896: Fixup some docs issues following ByteString deprecation (#104422) Co-authored-by: Jelle Zijlstra --- diff --git a/Doc/library/collections.abc.rst b/Doc/library/collections.abc.rst index 43a3286ba832..158f48516346 100644 --- a/Doc/library/collections.abc.rst +++ b/Doc/library/collections.abc.rst @@ -14,7 +14,10 @@ .. testsetup:: * - from collections.abc import * + import warnings + # Ignore warning when ByteString is imported + 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 eb13d4bf031c..546c7147bb3b 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.