◐ Shell
clean mode source ↗

gh-121272: compiler no longer modifies the symtable, ste_coroutine always set during symtable construction by iritkatriel · Pull Request #121297 · python/cpython

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@iritkatriel

@iritkatriel iritkatriel commented

Jul 2, 2024

edited

Loading

Copy link Copy Markdown

Member

Comment thread

Python/compile.c

compiler_exit_scope(c);
if (is_top_level_await && is_async_generator){
c->u->u_ste->ste_coroutine = 1;
assert(c->u->u_ste->ste_coroutine == 1);

Copy link Copy Markdown

Member Author

Choose a reason for hiding this comment

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

I believe this assignment has been obsolete for a while now, see #6766 (comment).

@JelleZijlstra JelleZijlstra left a comment

Copy link Copy Markdown

Member

Choose a reason for hiding this comment

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

Agree this is a job for the symtable, not the compiler. This looks to be well tested in test_compile_top_level_await in test_builtin.py.

iritkatriel reacted with thumbs up emoji

@iritkatriel iritkatriel merged commit 9315688 into python:main

Jul 3, 2024

noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request

Jul 11, 2024

estyxx pushed a commit to estyxx/cpython that referenced this pull request

Jul 17, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JelleZijlstra JelleZijlstra JelleZijlstra approved these changes

@carljm carljm Awaiting requested review from carljm carljm is a code owner

@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@iritkatriel @JelleZijlstra