-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
py/objcode: Remove co_lnotab from v2 preview. #17639
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AJMansfield
wants to merge
2
commits into
micropython:master
Choose a base branch
from
AJMansfield:deprecate_co_lnotab
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+38
−7
Conversation
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
bc273ac
to
aaeb97a
Compare
The intended commits here are only the last two:
Once #16989 is merged I'll rebase this so it doesn't include the commits from it that this PR depends on. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #17639 +/- ##
==========================================
- Coverage 98.44% 98.41% -0.04%
==========================================
Files 171 171
Lines 22208 22210 +2
==========================================
- Hits 21863 21857 -6
- Misses 345 353 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Code size report:
|
aaeb97a
to
732a7f4
Compare
This can now be rebased. |
732a7f4
to
77cd526
Compare
dpgeorge
reviewed
Jul 18, 2025
77cd526
to
baf93dd
Compare
Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
baf93dd
to
ddf2c3a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Starting in CPython 3.12, accessing the
co_lnotab
attribute on code objects results in a deprecation message; and in theory, attempting to use it will be an AttributeError in CPython 3.15. Likewise, the corresponding provision in PEP-626 states that "the co_lnotab attribute will be deprecated in 3.10 and removed in 3.12."Once #16989 is merged (to implement the
co_lines
method thatco_lnotab
is being removed in favor of), Micropython should follow suit to deprecate and removeco_lnotab
from our v2 previews (and eventually, the Micropython 2.0 release).This PR does this, adding
MICROPY_PREVIEW_VERSION_2
macro gates to theco_lnotab
attr entry and corresponding function implementation.Testing
This PR adds a new set of automated test cases to validate the v2 removal and pre-v2 non-removal of
co_lnotab
, replacing a test from #16989 that only applies to pre-v2.I've run these tests and verified correct behavior on both v2-preview and non-preview settrace builds of the unix port.
Trade-offs and Alternatives
Aside from the expected compatibility break with v2 preview, there are no downsides to this. This is a strict improvement to code size on settrace builds, and should have no effect on standard builds.