Message63082
The patch looks reasonable to me. Bytecode docs need to be changed. At
minimum like this:
===================================================================
--- Doc/library/dis.rst (revision 61097)
+++ Doc/library/dis.rst (working copy)
@@ -463,9 +463,9 @@
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.
.. opcode:: LOAD_LOCALS ()
========
More explanation on TOS being removed while TOS[-i] (obviously) not may
be in order.
For py3k similar optimization should be available for dict and set
comprehensions.
More unit tests will be helpful, particularly for nested iterations such
as [(x,y,z) for x in s for y in s for z in s]. |
|
| Date |
User |
Action |
Args |
| 2008-02-27 21:31:42 | belopolsky | set | spambayes_score: 9.30055e-05 -> 9.30055e-05 recipients:
+ belopolsky, nnorwitz |
| 2008-02-27 21:31:42 | belopolsky | set | spambayes_score: 9.30055e-05 -> 9.30055e-05 messageid: <1204147902.33.0.432303971694.issue2183@psf.upfronthosting.co.za> |
| 2008-02-27 21:31:41 | belopolsky | link | issue2183 messages |
| 2008-02-27 21:31:40 | belopolsky | create | |
|