You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a new bytecode instruction to create generators #90567
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/markshannon'closed_at=<Date2022-01-20.11:49:42.702>created_at=<Date2022-01-17.11:54:35.954>labels= ['interpreter-core', 'type-bug', '3.11']
title='Add a new bytecode instruction to create generators'updated_at=<Date2022-01-22.20:19:21.483>user='https://github.com/markshannon'
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.
Activity
markshannon commentedon Jan 17, 2022
(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.
markshannon commentedon Jan 20, 2022
New changeset b04dfbb by Mark Shannon in branch 'main':
bpo-46409: Make generators in bytecode (GH-30633)
b04dfbb