mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Issue #2183: Simplify and optimize bytecode for list comprehensions.
This commit is contained in:
parent
43caaa09ea
commit
d0c3515bc5
9 changed files with 34 additions and 63 deletions
|
@ -463,9 +463,11 @@ Miscellaneous opcodes.
|
|||
address to jump to (which should be a ``FOR_ITER`` instruction).
|
||||
|
||||
|
||||
.. opcode:: LIST_APPEND ()
|
||||
.. opcode:: LIST_APPEND (i)
|
||||
|
||||
Calls ``list.append(TOS1, TOS)``. Used to implement list comprehensions.
|
||||
Calls ``list.append(TOS[-i], TOS)``. Used to implement list comprehensions.
|
||||
While the appended value is popped off, the list object remains on the
|
||||
stack so that it is available for further iterations of the loop.
|
||||
|
||||
|
||||
.. opcode:: LOAD_LOCALS ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue