Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.10.rst
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ expected line number.

The :attr:`~codeobject.co_lnotab` attribute of
:ref:`code objects <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.

Expand Down
12 changes: 6 additions & 6 deletions Doc/whatsnew/3.12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
------------------------------

Expand All @@ -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
Expand Down
12 changes: 5 additions & 7 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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`:
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Misc/NEWS.d/3.12.0a7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

..

Expand Down