Skip to content

GH-145667: Merge GET_ITER and GET_YIELD_FROM_ITER#146120

Open
markshannon wants to merge 1 commit intopython:mainfrom
markshannon:breakup-yield-from-iter
Open

GH-145667: Merge GET_ITER and GET_YIELD_FROM_ITER#146120
markshannon wants to merge 1 commit intopython:mainfrom
markshannon:breakup-yield-from-iter

Conversation

@markshannon
Copy link
Member

@markshannon markshannon commented Mar 18, 2026

Also modifies SEND to make it a bit more like FOR_ITER as both are now fed by GET_ITER.

Apart from saving an opcode, this will enable broadly similar optimizations to be applied to SEND as are already applied to FOR_ITER. Which should:

  • significantly improve the performance of yield from seq where seq is a common iterable, like list.
  • allow the JIT to trace through SEND as it will be mostly specialized.

For now, this is broadly performance neutral, between +0% and -1%, mostly about 0%.

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.

1 participant