| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 78a0e2c commit b4ac161
16 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -824,7 +824,8 @@ iterations of the loop. | |||
| 824 | 824 | oparg set to be the exception block depth, for efficient closing of generators. | |
| 825 | 825 | ||
| 826 | 826 | .. versionchanged:: 3.13 | |
| 827 | - this opcode no longer has an oparg | ||
| 827 | + oparg is ``1`` if this instruction is part of a yield-from or await, and ``0`` | ||
| 828 | + otherwise. | ||
| 828 | 829 | ||
| 829 | 830 | .. opcode:: SETUP_ANNOTATIONS | |
| 830 | 831 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -948,7 +948,8 @@ Others | |||
| 948 | 948 | CPython bytecode changes | |
| 949 | 949 | ======================== | |
| 950 | 950 | ||
| 951 | - * ``YIELD_VALUE`` no longer has an oparg. The oparg of ``RESUME`` was | ||
| 951 | + * The oparg of ``YIELD_VALUE`` is now ``1`` if the yield is part of a | ||
| 952 | + yield-from or await, and ``0`` otherwise. The oparg of ``RESUME`` was | ||
| 952 | 953 | changed to add a bit indicating whether the except-depth is 1, which | |
| 953 | 954 | is needed to optimize closing of generators. | |
| 954 | 955 | (Contributed by Irit Katriel in :gh:`111354`.) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,13 +36,16 @@ extern PyFrameObject* _PyFrame_New_NoTrack(PyCodeObject *code); | |||
| 36 | 36 | /* other API */ | |
| 37 | 37 | ||
| 38 | 38 | typedef enum _framestate { | |
| 39 | - FRAME_CREATED = -2, | ||
| 40 | - FRAME_SUSPENDED = -1, | ||
| 39 | + FRAME_CREATED = -3, | ||
| 40 | + FRAME_SUSPENDED = -2, | ||
| 41 | + FRAME_SUSPENDED_YIELD_FROM = -1, | ||
| 41 | 42 | FRAME_EXECUTING = 0, | |
| 42 | 43 | FRAME_COMPLETED = 1, | |
| 43 | 44 | FRAME_CLEARED = 4 | |
| 44 | 45 | } PyFrameState; | |
| 45 | 46 | ||
| 47 | + #define FRAME_STATE_SUSPENDED(S) ((S) == FRAME_SUSPENDED || (S) == FRAME_SUSPENDED_YIELD_FROM) | ||
| 48 | + | ||
| 46 | 49 | enum _frameowner { | |
| 47 | 50 | FRAME_OWNED_BY_THREAD = 0, | |
| 48 | 51 | FRAME_OWNED_BY_GENERATOR = 1, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments