[Python-Dev] Don't set local variable in a list comprehension or generator

Greg Ewing greg.ewing at canterbury.ac.nz
Thu May 19 14:16:31 CEST 2011


Victor Stinner wrote:

> I suppose that you have the current value of range(10000) on the stack:
> DUP_TOP; BINARY_MULTIPLY; gives you the square. You don't need the x
> variable (LOAD_FAST/STORE_FAST).

That seems far too special-purpose to be worth it to me.

-- 
Greg


More information about the Python-Dev mailing list