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

Make _PyASTOptimizeState internal to ast_opt.c #105148

Closed
iritkatriel opened this issue May 31, 2023 · 0 comments · Fixed by #105149
Closed

Make _PyASTOptimizeState internal to ast_opt.c #105148

iritkatriel opened this issue May 31, 2023 · 0 comments · Fixed by #105149
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@iritkatriel
Copy link
Member

iritkatriel commented May 31, 2023

ast_opt.c imports pycore_compile.c inly for _PyASTOptimizeState, which could be defined in ast_opt.c instead.

We need to change the signature of _PyAST_Optimize to take two integers (optimization level and flags) instead of a _PyASTOptimizeState pointer. This will slightly simplify the call sites of _PyAST_Optimize, where this struct is created just to hold those two ints and pass it to _PyAST_Optimize.

Linked PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant