Skip to content

Commit ce4eecf

Browse files
gh-91896: Fixup some docs issues following ByteString deprecation (#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

Lines changed: 4 additions & 1 deletion
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

Lines changed: 3 additions & 0 deletions
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)
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