mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
GH-132554: "Virtual" iterators (GH-132555)
* FOR_ITER now pushes either the iterator and NULL or leaves the iterable and pushes tagged zero * NEXT_ITER uses the tagged int as the index into the sequence or, if TOS is NULL, iterates as before.
This commit is contained in:
parent
9300a596d3
commit
f6f4e8a662
25 changed files with 713 additions and 618 deletions
|
@ -1386,6 +1386,10 @@ mark_stacks(PyCodeObject *code_obj, int len)
|
|||
stacks[j] = next_stack;
|
||||
break;
|
||||
case GET_ITER:
|
||||
next_stack = push_value(pop_value(next_stack), Iterator);
|
||||
next_stack = push_value(next_stack, Iterator);
|
||||
stacks[next_i] = next_stack;
|
||||
break;
|
||||
case GET_AITER:
|
||||
next_stack = push_value(pop_value(next_stack), Iterator);
|
||||
stacks[next_i] = next_stack;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue