This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients belopolsky, nnorwitz
Date 2008-02-27.21:31:40
SpamBayes Score 9.3005474e-05
Marked as misclassified No
Message-id <1204147902.33.0.432303971694.issue2183@psf.upfronthosting.co.za>
In-reply-to
Content
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].
History
Date User Action Args
2008-02-27 21:31:42belopolskysetspambayes_score: 9.30055e-05 -> 9.3005474e-05
recipients: + belopolsky, nnorwitz
2008-02-27 21:31:42belopolskysetspambayes_score: 9.30055e-05 -> 9.30055e-05
messageid: <1204147902.33.0.432303971694.issue2183@psf.upfronthosting.co.za>
2008-02-27 21:31:41belopolskylinkissue2183 messages
2008-02-27 21:31:40belopolskycreate