Skip to content

bpo-45056: Remove trailing unused constants from co_consts #28109

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

Merged
merged 6 commits into from
Sep 2, 2021

Conversation

methane
Copy link
Member

@methane methane commented Sep 1, 2021

@pablogsal
Copy link
Member

You need to regenerate importlib no?

@methane
Copy link
Member Author

methane commented Sep 1, 2021

You need to regenerate importlib no?

Yes. But it will cause conflict soon. So I want to delay make regen after code review.

@@ -7868,6 +7871,9 @@ assemble(struct compiler *c, int addNone)
if (duplicate_exits_without_lineno(c)) {
return NULL;
Copy link
Member

Choose a reason for hiding this comment

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

Now, I am curious why this isn’t “go to error”.

@gvanrossum
Copy link
Member

What if unused constants appear in the middle? Can that happen?

@methane
Copy link
Member Author

methane commented Sep 2, 2021

What if unused constants appear in the middle? Can that happen?

Yes, there are some cases. This pull request doesn't remove them because I am focusing the regressin at Python 3.10.
I uploaded the dump of unused constants of _pyio.py file at the b.p.o. Please see the diff of them.
Python 3.10 appends unused None for many functions.

@ambv ambv merged commit 55c4a92 into python:main Sep 2, 2021
@miss-islington
Copy link
Contributor

Thanks @methane for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry, @methane and @ambv, I could not cleanly backport this to 3.10 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 55c4a92fc1abfe388335071f1d64b3addfa5793f 3.10

@ambv
Copy link
Contributor

ambv commented Sep 2, 2021

@methane, I'll deal with the backport.

ambv pushed a commit to ambv/cpython that referenced this pull request Sep 2, 2021
…thonGH-28109).

(cherry picked from commit 55c4a92)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Sep 2, 2021
@bedevere-bot
Copy link

GH-28125 is a backport of this pull request to the 3.10 branch.

ambv added a commit that referenced this pull request Sep 8, 2021
…-28109) (GH-28125)

(cherry picked from commit 55c4a92)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
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.

7 participants