◐ Shell
reader mode source ↗
Skip to content

bpo-43683: Handle generator entry in bytecode#25138

Merged
markshannon merged 2 commits into
python:masterfrom
faster-cpython:handle-generator-entry-in-bytecode
Apr 6, 2021
Merged

bpo-43683: Handle generator entry in bytecode#25138
markshannon merged 2 commits into
python:masterfrom
faster-cpython:handle-generator-entry-in-bytecode

Conversation

@markshannon

@markshannon markshannon commented Apr 1, 2021

Copy link
Copy Markdown
Member

Adds GEN_START bytecode to handle checking for None when starting a generator or coroutine.

This means that:

  • send() doesn't need to check the state of the generator.
  • Should speed up iteration as check is only performed once per generator, not once per iteration.

https://bugs.python.org/issue43683

@willingc willingc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hide comment

LGTM

…o bytecode.

Document new bytecode and make it fail gracefully if mis-compiled.

Add NEWS item

Bump magic number.
@python python deleted a comment from fochoao Apr 6, 2021
@markshannon

Copy link
Copy Markdown
Member Author

Fixes are in #25224

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants