diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-06-07 03:43:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-07 03:43:17 (GMT) |
commit | 56a7e0483436d1ebd2af97c02defe0e67c4bb495 (patch) | |
tree | 04b0c8ad8d4db46be7c8da2668301538345ee994 /Doc/whatsnew/3.12.rst | |
parent | d4566c0cfcc2f3db8fa61b35f99260c184416ba4 (diff) | |
download | cpython-56a7e0483436d1ebd2af97c02defe0e67c4bb495.zip cpython-56a7e0483436d1ebd2af97c02defe0e67c4bb495.tar.gz cpython-56a7e0483436d1ebd2af97c02defe0e67c4bb495.tar.bz2 |
[3.13] gh-119577: Adjust DeprecationWarning when testing element truth values in ElementTree (GH-119762) (GH-120189)
gh-119577: Adjust DeprecationWarning when testing element truth values in ElementTree (GH-119762)
Adjust DeprecationWarning when testing element truth values in ElementTree, we're planning to go with the more natural True return rather than a disruptive harder to code around exception raise, and are deferring the behavior change for a few more releases.
(cherry picked from commit 6b606522ca97488aad6fe2f193d4511e7a8f8334)
Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
Diffstat (limited to 'Doc/whatsnew/3.12.rst')
-rw-r--r-- | Doc/whatsnew/3.12.rst | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index d9a314e..f3cabb7 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -1440,8 +1440,6 @@ and will be removed in Python 3.14. * :mod:`typing`: :class:`!typing.ByteString` -* :mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`xml.etree.ElementTree.Element`. - * The ``__package__`` and ``__cached__`` attributes on module objects. * The :attr:`~codeobject.co_lnotab` attribute of code objects. @@ -1467,6 +1465,11 @@ although there is currently no date scheduled for their removal. * :class:`typing.Text` (:gh:`92332`) +* :mod:`xml.etree.ElementTree`: Testing the truth value of an + :class:`xml.etree.ElementTree.Element` is deprecated. In a future release it + will always return True. Prefer explicit ``len(elem)`` or + ``elem is not None`` tests instead. + * Currently Python accepts numeric literals immediately followed by keywords, for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and ambiguous expressions like ``[0x1for x in y]`` (which can be |