Issue 46409: Add a new bytecode instruction to create generators - Python tracker

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Mark.Shannon Nosy List: Mark.Shannon, sobolevn
Priority: normal Keywords: patch

Created on 2022-01-17 11:54 by Mark.Shannon, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 30633 merged Mark.Shannon, 2022-01-17 12:54
PR 30780 sobolevn, 2022-01-22 20:19
Messages (2)
msg410764 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2022-01-17 11:54
(including coroutines, and async generators)

We now make the start and resumption of Python functions explicit in the bytecode which allows us to initialize frames in the bytecode without exposing incomplete frames tracing, the GC etc.
However, we still expose incomplete frames when creating generators.

By making the creation of generators explicit in the bytecode we first create the frame, then the generator and all is well.

See https://bugs.python.org/issue46374 and https://bugs.python.org/issue46389 for examples.
msg411018 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2022-01-20 11:46
New changeset b04dfbbe4bd7071d46c8688c2263726ea31d33cd by Mark Shannon in branch 'main':
bpo-46409: Make generators in bytecode (GH-30633)
https://github.com/python/cpython/commit/b04dfbbe4bd7071d46c8688c2263726ea31d33cd