Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
gh-101865: Deprecateco_lnotab
from code objects as per PEP 626#101866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes from1 commit
Commits
Show all changes
10 commits Select commitHold shift + click to select a range
06a79d9
gh-101865: Remove deprecated `co_lnotab` from code objects as per PEP626
sobolevndd65849
Revert "gh-101865: Remove deprecated `co_lnotab` from code objects as…
sobolevn1a6b7bb
Deprecate `co_lnotab` instead of removing it
sobolevn67a1c98
Update gdbinit
sobolevn7d69360
Merge branch 'main' into issue-101865
arhadthedev2fc556e
Address review
sobolevncba6b24
Address review
sobolevn4cc08ea
Merge branch 'main' into issue-101865
sobolevna35ada1
Merge branch 'main' into issue-101865
sobolevn0966c8c
Address review
sobolevnFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
Deprecate
co_lnotab
instead of removing it- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit1a6b7bb5f7a22e1cdab3925239b2f662cde7de35
There are no files selected for viewing
6 changes: 6 additions & 0 deletionsDoc/whatsnew/3.12.rst
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -516,6 +516,12 @@ Pending Removal in Python 3.14 | ||
functions that have been deprecated since Python 2 but only gained a | ||
proper :exc:`DeprecationWarning` in 3.12. Remove them in 3.14. | ||
* Accessing ``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. | ||
Remove it in 3.14. | ||
sobolevn marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
(Contributed by Nikita Sobolev in :gh:`101866`.) | ||
Pending Removal in Future Versions | ||
---------------------------------- | ||
7 changes: 7 additions & 0 deletionsLib/test/test_code.py
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
2 changes: 2 additions & 0 deletionsMisc/NEWS.d/next/Core and Builtins/2023-02-21-17-22-06.gh-issue-101865.fwrTOA.rst
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Deprecate ``co_lnotab`` in code objects, schedule it for removal in Python | ||
3.14 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1884,6 +1884,13 @@ static PyMemberDef code_memberlist[] = { | ||
static PyObject * | ||
code_getlnotab(PyCodeObject *code, void *closure) | ||
{ | ||
if (PyErr_WarnEx(PyExc_DeprecationWarning, | ||
"co_lnotab is deprecated since Python 3.12 " | ||
"and will be removed in Python 3.14, " | ||
sobolevn marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
"use co_lines instead.", | ||
1) < 0) { | ||
return NULL; | ||
} | ||
return decode_linetable(code); | ||
} | ||
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.