← 返回首页
gh-101865: Deprecate `co_lnotab` from code objects as per PEP 626 by sobolevn · Pull Request #101866 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

gh-101865: Deprecate co_lnotab from code objects as per PEP 626#101866

Merged
ambv merged 10 commits into
python:mainfrom
sobolevn:issue-101865
Apr 3, 2023
Merged

gh-101865: Deprecate co_lnotab from code objects as per PEP 626#101866
ambv merged 10 commits into
python:mainfrom
sobolevn:issue-101865

Conversation

sobolevn commented Feb 13, 2023
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

I still have to fix these lines:

cpython/Misc/gdbinit

Lines 60 to 61 in 6ef6915

set $__sz = ((PyVarObject *)$__co->co_lnotab)->ob_size/2
set $__p = (unsigned char *)((PyBytesObject *)$__co->co_lnotab)->ob_sval

But, since I have 0 experience with gdb it might take some time.

Copy link
Copy Markdown
Member Author

I've pushed my naive attempt to fix gdb: since it only needs a current line f->f_lineno seems like a tool for the job. (again, this is my very first time working with gdb)

Copy link
Copy Markdown
Member Author

@markshannon friendly ping :)

sobolevn changed the title gh-101865: Remove deprecated co_lnotab from code objects as per PEP626 gh-101865: Deprecate co_lnotab from code objects as per PEP626 Feb 21, 2023

sobolevn commented Feb 22, 2023
edited
Loading

Copy link
Copy Markdown
Member Author

Failures do not seem related 🤔

arhadthedev commented Feb 25, 2023
edited
Loading

Copy link
Copy Markdown
Member

test_implied_dirs_performance issue was fixed in gh-102225 so merging main should help.

Copy link
Copy Markdown
Member Author

@markshannon do you have time to re-review this, please? :)

sobolevn commented Mar 18, 2023
edited
Loading

Copy link
Copy Markdown
Member Author

@carljm maybe you can have a look? :)

markshannon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Looks good in general.
We aren't obliged to remove co_lnotab in 3.14, but we can. Perhaps change the "will"s to "may"s.

Not sure what to do about Misc/gdbinit though.

Comment thread Doc/whatsnew/3.12.rst Outdated Show resolved Hide resolved
Comment thread Misc/gdbinit Outdated Show resolved Hide resolved
Comment thread Objects/codeobject.c Outdated Show resolved Hide resolved

Copy link
Copy Markdown
Member

Perhaps we should discuss the future of Misc/gdbinit in another issue, and not worry about it here.

Copy link
Copy Markdown
Member Author

@markshannon thanks a lot for your review and for all your hard work on CPython!

  1. I've addressed all your comments
  2. I've opened a new issue about Misc/gdbinit: What to do with Misc/gdbinit? #102809

hugovk commented Mar 18, 2023

Copy link
Copy Markdown
Member

Shall we add a .. deprecated-removed: 3.12 3.14 in the main docs, somewhere near https://docs.python.org/3.12/reference/datamodel.html?highlight=co_lnotab ?

hugovk changed the title gh-101865: Deprecate co_lnotab from code objects as per PEP626 gh-101865: Deprecate co_lnotab from code objects as per PEP 626 Mar 18, 2023

sobolevn commented Mar 19, 2023
edited
Loading

Copy link
Copy Markdown
Member Author

I think that we can add "is deprecated since 3.12 and may be removed in 3.14".
But this directive won't work, because it is a raw text:

  1. https://github.com/python/cpython/blame/3adb23a17d25e36bd80874e860835182d851623f/Doc/reference/datamodel.rst#L965
  2. https://github.com/python/cpython/blame/3adb23a17d25e36bd80874e860835182d851623f/Doc/reference/datamodel.rst#L992

hugovk commented Mar 19, 2023

Copy link
Copy Markdown
Member

I think that we can add "is deprecated since 3.12 and may be removed in 3.14".

Sure, let's do something like that.

Copy link
Copy Markdown
Member Author

gdbinit was removed in #102854 🎉

sobolevn commented Apr 3, 2023

Copy link
Copy Markdown
Member Author

@markshannon I've solved the merge conflicts. I hope that this is ready to be merged when you have the time :)

ambv merged commit 2a72125 into python:main Apr 3, 2023
gaogaotiantian pushed a commit to gaogaotiantian/cpython that referenced this pull request Apr 8, 2023
…26 (python#101866) Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
warsaw pushed a commit to warsaw/cpython that referenced this pull request Apr 11, 2023
…26 (python#101866) Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Footer

© 2026 GitHub, Inc.