Message51017
Logged In: YES
user_id=80475
Genexps necessarily need a separate stack frame to achieve
saved execution state (including the instruction pointer and
local variable). Also, it was simplest to implement genexps
in terms of the existing and proven code for regular generators.
For list and set comps, I think you can take a simpler
approach and just rename the inner loop variable to
something invisible. That will make it faster, make the
disassemby readable, and make it easier to follow in pdb.
Also, we get to capitalize on proven code -- they only
difference is that the induction variable won't be visible
to surrounding code.
Since what you have works, I would say just check it in;
however, it would probably never get touched again and an
early, arbitrary design choice would get set in stone. My
bet is that the renaming approach will result in a much
simpler patch. |
|
Date |
User |
Action |
Args |
2007-08-23 15:54:24 | admin | link | issue1548388 messages |
2007-08-23 15:54:24 | admin | create | |
|