Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ce4eecf

Browse files
AlexWaygoodJelleZijlstra
andauthoredMay 12, 2023
pythongh-91896: Fixup some docs issues following ByteString deprecation (python#104422)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
1 parent a052be4 commit ce4eecf

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
 

‎Doc/library/collections.abc.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414

1515
.. testsetup:: *
1616

17-
from collections.abc import *
17+
import warnings
18+
# Ignore warning when ByteString is imported
19+
with warnings.catch_warnings(action='ignore', category=DeprecationWarning):
20+
from collections.abc import *
1821
import itertools
1922
__name__ = '<doctest>'
2023

‎Doc/whatsnew/3.12.rst

+3
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,9 @@ Pending Removal in Python 3.14
831831
For use in typing, prefer a union, like ``bytes | bytearray``, or :class:`collections.abc.Buffer`.
832832
(Contributed by Shantanu Jain in :gh:`91896`.)
833833

834+
* :class:`typing.ByteString`, deprecated since Python 3.9, now causes an
835+
:exc:`DeprecationWarning` to be emitted when it is used or accessed.
836+
834837
* Creating immutable types (:data:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable
835838
bases using the C API.
836839

0 commit comments

Comments
 (0)
Please sign in to comment.