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
bpo-42217: compiler: merge same co_code and co_linetable objects #23056
Conversation
This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days |
@@ -0,0 +1 @@ | |||
Make the compiler merges co_code and co_lnotab in a module. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the compiler merges co_code and co_lnotab in a module. | |
Make the compiler merge module attributes co_code and co_lnotab. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not module attributes.
There are many code objects in module. All code modules have co_code and co_lnotab that are bytes objects.
Since bytes objects are immutables, same objects can be shared.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about "Make the compiler merges same co_code and co_linetable objects in a module like already did for co_consts."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, then I don’t understand this well enough (the PR or the suggested text) to say 😐
When you pick a phrasing, I think it will be necessary to update the PR title so that the resulting squashed commit is correct + fix the extra s (should be make compiler merge
, not merges).
When I read this, I imagine that .co_code and .co_lnotab will now point to the same bytes object. |
Make the compiler merges co_code and co_lnotab in a module, like already done for co_consts.
https://bugs.python.org/issue42217