v0.0.343: generator / coroutine introspection (gi_/cr_/ag_)#264
Merged
Conversation
Closes F2 from the v0.1.0 audit. *object.Generator backs all three
types; the prefix gi_ / cr_ / ag_ is picked from Code.Flags. Surfaced
attrs:
*_frame TracebackFrame{Code} while live, None after Done.
*_code underlying *object.Code.
*_running new Running flag set during resume/throw dispatch.
gi_yieldfrom / cr_await / ag_await None (no delegated tracking).
gi_suspended Started && !Done && !Running.
cr_origin None.
pytest-asyncio and trio gate test-fixture cleanup on cr_running so this
unblocks them. PEP 667 FrameLocalsProxy and yield-from tracking remain
out of scope.
Spec at notes/Spec/1500/1537_goipy_v0043_generator_introspection.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gi_*/cr_*/ag_*) — frame, code, running, suspended, yieldfrom/await, origin.Runningflag on*object.Generator, set during resume/throw dispatch.notes/Spec/1500/1537_goipy_v0043_generator_introspection.md. Fixture:internal/testdata/343_generator_introspection.py.Test plan
go test ./... -timeout 600sgreen