10000 Remove `_PyCompile_IsNestedScope` roll it into `_PyCompile_IsInteractive` · Issue #124058 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

Remove _PyCompile_IsNestedScope roll it into _PyCompile_IsInteractive #124058

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

Closed
iritkatriel opened this issue Sep 13, 2024 · 1 comment · Fixed by #124061
Closed

Remove _PyCompile_IsNestedScope roll it into _PyCompile_IsInteractive #124058

iritkatriel opened this issue Sep 13, 2024 · 1 comment · Fixed by #124061
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@iritkatriel
Copy link
Member
iritkatriel commented Sep 13, 2024

Currently the c_interactive field is used in only one place - to special-case the code generation of interactive statements. We can move this special case from codegen_stmt_expr to _PyCodegen_Body (where there is the is_interactive arg) and then we no longer need c_interactive, its accessor function _PyCompile_IsInteractive, and the _PyCompile_IsNestedScope function.

Linked PRs

@iritkatriel iritkatriel added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Sep 13, 2024
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Sep 13, 2024
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Sep 13, 2024
@iritkatriel iritkatriel changed the title Remove c_interactive from the compiler struct, as well as _PyCompile_IsInteractive and _PyCompile_IsNestedScope Remove _PyCompile_IsNestedScope roll it into _PyCompile_IsInteractive and `` Sep 14, 2024
@iritkatriel
Copy link
Member Author

The original plan turnout out too complicated. Instead I'll remove _PyCompile_IsNestedScope from the compiler's API and make _PyCompile_IsInteractive apply its logic.

iritkatriel added a commit to iritkatriel/cpython that referenced this issue Sep 14, 2024
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Sep 14, 2024
@iritkatriel iritkatriel changed the title Remove _PyCompile_IsNestedScope roll it into _PyCompile_IsInteractive and `` Remove _PyCompile_IsNestedScope roll it into _PyCompile_IsInteractive Sep 15, 2024
savannahostrowski pushed a commit to savannahostrowski/cpython that referenced this issue Sep 22, 2024
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)
Projects
None yet
1 participant
0