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
Unneeded constants left during optimization #44188
Comments
At some point, when generating the bytecode, the To keep this description from being lengthy, I'm |
Logged In: YES Sorry, I rushed and missed the File Description field. |
Logged In: YES Would you like to work on a patch to fix this problem? |
Logged In: YES I looked at this when constant folding was first introduced Here's an example of the difficulty: >>> def f():
x = 3
y = 3 + 4
return x + y
>>> f.func_code.co_consts
(None, 3, 4, 7) The constant folding for 3+4 introduces the 7 but cannot Am reclassifying this as a feature request for a trivial |
Logged In: YES loewis: rhettinger: All in all, sorry for being too nitpicky. I know this isn't |
Logged In: YES kamek: with the current peephole pass, it wouldn't be easy Closing this as "won't fix", then, as nobody seems to be If this is ever attempted, I think the constant folding |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: