Skip to content

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Mar 26, 2025

Copy link
Member

@brandtbucher brandtbucher 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, thanks for the quick fix.

Looking at the _IS_NONE example, is there a way so that the new line is only added to the bottom of the first arm? It seems inefficient to store it twice whenever the else branch is taken (but maybe it's too difficult to avoid).

stack_pointer = _PyFrame_GetStackPointer(frame);
}
}
stack_pointer[-1] = iter;
Copy link
Member

Choose a reason for hiding this comment

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

Not something to be fixed here, but worth noting that this is unnessesary (the only paths that don't store iter set iter = iterable, which leaves the stack unchanged). Could be pretty difficult for the code generator to reason about though, I don't know...

Copy link
Member Author

Choose a reason for hiding this comment

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

This won't be an issue with top-of-stack caching, so I'm not concerned about it.

@markshannon markshannon merged commit d836d28 into python:main Mar 27, 2025
63 checks passed
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 1, 2025
seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants