diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index b939ccd17903f21..4b4f399a19273fd 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -404,7 +404,7 @@ expected line number. The :attr:`~codeobject.co_lnotab` attribute of :ref:`code objects ` is deprecated and -will be removed in 3.12. +may be removed in a future version. Code that needs to convert from offset to line number should use the new :meth:`~codeobject.co_lines` method instead. diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 28b28e9ce50e11c..03f78c550e0cdc5 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -1324,10 +1324,10 @@ Deprecated ``int``, convert to int explicitly: ``~int(x)``. (Contributed by Tim Hoffmann in :gh:`103487`.) -* Accessing :attr:`~codeobject.co_lnotab` on code objects was deprecated in - Python 3.10 via :pep:`626`, - but it only got a proper :exc:`DeprecationWarning` in 3.12, - therefore it will be removed in 3.14. +* :class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was + deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, + but it only got a proper :exc:`DeprecationWarning` in 3.12. May be removed + in a future version. Use the :meth:`codeobject.co_lines` method instead. (Contributed by Nikita Sobolev in :gh:`101866`.) Pending Removal in Python 3.13 @@ -1442,8 +1442,6 @@ and will be removed in Python 3.14. * The ``__package__`` and ``__cached__`` attributes on module objects. -* The :attr:`~codeobject.co_lnotab` attribute of code objects. - Pending Removal in Python 3.15 ------------------------------ @@ -1463,6 +1461,8 @@ although there is currently no date scheduled for their removal. * :mod:`array`'s ``'u'`` format code (:gh:`57281`) +* The :attr:`~codeobject.co_lnotab` attribute of code objects. + * :class:`typing.Text` (:gh:`92332`) * :mod:`xml.etree.ElementTree`: Testing the truth value of an diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 81daaabdb889d7b..6c64ae6df1bc1a5 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -1713,13 +1713,6 @@ Pending Removal in Python 3.14 * date and datetime adapter, date and timestamp converter: see the :mod:`sqlite3` documentation for suggested replacement recipes. -* :class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was - deprecated in :pep:`626` - since 3.10 and was planned to be removed in 3.12, - but it only got a proper :exc:`DeprecationWarning` in 3.12. - May be removed in 3.14. - (Contributed by Nikita Sobolev in :gh:`101866`.) - * :mod:`typing`: :class:`!typing.ByteString`, deprecated since Python 3.9, now causes a :exc:`DeprecationWarning` to be emitted when it is used. @@ -1835,6 +1828,11 @@ although there is currently no date scheduled for their removal. * :attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method instead. + Accessing :attr:`~codeobject.co_lnotab` was deprecated in :pep:`626` + since 3.10 and was planned to be removed in 3.12, but it only got a + proper :exc:`DeprecationWarning` in 3.12. + (Contributed by Nikita Sobolev in :gh:`101866`.) + * :mod:`datetime`: * :meth:`~datetime.datetime.utcnow`: diff --git a/Lib/test/test_code.py b/Lib/test/test_code.py index ba77e1c5341db83..875929a09a53757 100644 --- a/Lib/test/test_code.py +++ b/Lib/test/test_code.py @@ -348,7 +348,7 @@ def func(): new_code = code = func.__code__.replace(co_linetable=b'') self.assertEqual(list(new_code.co_lines()), []) - def test_co_lnotab_is_deprecated(self): # TODO: remove in 3.14 + def test_co_lnotab_is_deprecated(self): # TODO: remove in 3.14 or later def func(): pass diff --git a/Misc/NEWS.d/3.12.0a7.rst b/Misc/NEWS.d/3.12.0a7.rst index a859be8a0474561..3cee41aef47bc55 100644 --- a/Misc/NEWS.d/3.12.0a7.rst +++ b/Misc/NEWS.d/3.12.0a7.rst @@ -200,7 +200,7 @@ Bachmann. .. section: Core and Builtins Deprecate ``co_lnotab`` in code objects, schedule it for removal in Python -3.14 +3.14 or later. ..