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
Title: Add a new bytecode instruction to create generators
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.11
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
History
Date User Action Args
2022-04-11 14:59:54adminsetgithub: 90567
2022-01-22 20:19:21sobolevnsetnosy: + sobolevn

pull_requests: + pull_request28991
2022-01-20 11:49:42Mark.Shannonsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2022-01-20 11:46:52Mark.Shannonsetmessages: + msg411018
2022-01-17 12:54:49Mark.Shannonsetkeywords: + patch
stage: patch review
pull_requests: + pull_request28836
2022-01-17 11:54:35Mark.Shannoncreate