]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-91896: Fixup some docs issues following ByteString deprecation (#104422)
authorAlex Waygood <Alex.Waygood@Gmail.com>
Fri, 12 May 2023 14:38:35 +0000 (15:38 +0100)
committerGitHub <noreply@github.com>
Fri, 12 May 2023 14:38:35 +0000 (15:38 +0100)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Doc/library/collections.abc.rst
Doc/whatsnew/3.12.rst

index 43a3286ba832cf0ce731ae5ce3cd535fb85eb462..158f485163465239f1a16bb8924be6e068f2923b 100644 (file)
 
 .. 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__ = '<doctest>'
 
index eb13d4bf031c959ba9b744497261c8ea76fb315c..546c7147bb3b27711bca4d4cb7c938011585d76c 100644 (file)
@@ -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.