-
-
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
Conversation
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
77cd526
to
baf93dd
Compare
Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
baf93dd
to
ddf2c3a
Compare
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.