summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2008-12-17 00:38:28 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2008-12-17 00:38:28 (GMT)
commitd0c3515bc5b31a19d00bfc685d7657ad7d79fa94 (patch)
tree299253e76cf9b66349bdaf0cca8c95da19671c74 /Doc
parent43caaa09ea364aab6cbd7ede2aa9c3d004a129a5 (diff)
downloadcpython-d0c3515bc5b31a19d00bfc685d7657ad7d79fa94.zip
cpython-d0c3515bc5b31a19d00bfc685d7657ad7d79fa94.tar.gz
cpython-d0c3515bc5b31a19d00bfc685d7657ad7d79fa94.tar.bz2
Issue #2183: Simplify and optimize bytecode for list comprehensions.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/dis.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst
index 84a0c25..e9cbb13 100644
--- a/Doc/library/dis.rst
+++ b/Doc/library/dis.rst
@@ -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 ()