Skip to content

Make _PyASTOptimizeState internal to ast_opt.c #105148

Closed
@iritkatriel

Description

@iritkatriel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions