Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-115347: avoid emitting redundant NOP for the docstring with -OO #115494

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 2 commits into from
Feb 15, 2024

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Feb 15, 2024

Copy link
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

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

Looks good.

I can't help thinking that extracting the docstring is the parser's or symbol table generator's job. Probably not worth the effort to change it though.

@iritkatriel
Copy link
Member Author

Looks good.

I can't help thinking that extracting the docstring is the parser's or symbol table generator's job. Probably not worth the effort to change it though.

Note that you can call compile with an optmization level different from the process' and you can give it an AST to compile. So the earliest we can do this is in AST optimization stage.

@iritkatriel iritkatriel merged commit 732faf1 into python:main Feb 15, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
LukasWoodtli pushed a commit to LukasWoodtli/cpython that referenced this pull request Jan 22, 2025
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.

Redundant NOP is generated in -OO mode
2 participants