Skip to content
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

Merged
merged 7 commits into from Feb 10, 2021

Conversation

methane
Copy link
Member

@methane methane commented Oct 31, 2020

Make the compiler merges co_code and co_lnotab in a module, like already done for co_consts.

https://bugs.python.org/issue42217

@methane methane changed the title bpo-42217: Merge co_code and co_lnotab bpo-42217: compiler: Merge co_code and co_lnotab Oct 31, 2020
@github-actions
Copy link

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

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Dec 16, 2020
@@ -0,0 +1 @@
Make the compiler merges co_code and co_lnotab in a module.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Make the compiler merges co_code and co_lnotab in a module.
Make the compiler merge module attributes co_code and co_lnotab.

Copy link
Member Author

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.

Copy link
Member Author

@methane methane Feb 8, 2021

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."

Copy link
Member

@merwok merwok Feb 9, 2021

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).

@pfalcon
Copy link

pfalcon commented Jan 13, 2021

Make the compiler merges co_code and co_lnotab

When I read this, I imagine that .co_code and .co_lnotab will now point to the same bytes object.

@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label Jan 14, 2021
@methane methane changed the title bpo-42217: compiler: Merge co_code and co_lnotab bpo-42217: compiler: merge same co_code and co_linetable objects Feb 9, 2021
@methane methane merged commit bdb941b into python:master Feb 10, 2021
@methane methane deleted the merge-code branch February 10, 2021 00:20
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.

None yet

5 participants