Ok, somebody go for it! (Also please refer to my pronouncement in the bug
-- I've gotta run.)
On Wed, Nov 7, 2012 at 7:12 AM, Nick Coghlan
On Thu, Nov 8, 2012 at 12:54 AM, Guido van Rossum
wrote: On Wed, Nov 7, 2012 at 4:13 AM, Ned Batchelder
wrote: If the bug report is accurate, CPython and the reference manual have disagreed since Python 2.5, and many of us are now surprised to hear it, which means there can't have been much broken code.
Give that it was discussed before and fixed before, I think the intent is clear: we should fix the code, not the docs.
Almost certainly, it was broken in the migration to the AST compiler and there was no regression test to pick up the change.
I haven't looked at the proposed fixes, but I think correctness is more important than saving an extra bytecode (OTOH keeping the set of opcodes the same trumps both). I can't imagine that this extra opcode will be significant in many cases.
Since you've indicated the implementation is in the wrong here and you also want to preserve opcode semantics, I think Skip's patch is correct, but also needs to be applied to dict comprehensions (now we have them). The extra bytecode is only ROT_TWO, which is one of the cheapest we have kicking around :)
Cheers, Nick.
-- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia
-- --Guido van Rossum (python.org/~guido)