[Python-Dev] LOAD_CONST POP_TOP (original) (raw)

Georg Brandl g.brandl at gmx.net
Fri Jun 30 20:39:13 CEST 2006


Hi,

the following patch tries to fix the LOAD_CONST POP_TOP optimization lost in 2.5 (bug #1333982).

An example for this is:

def f(): 'a' # docstring 'b'

Georg

PS: Hmm. While looking, I see that 2.4 doesn't optimize away other constants like

def g(): 1

Index: Python/compile.c

--- Python/compile.c (Revision 47150) +++ Python/compile.c (Arbeitskopie) @@ -775,10 +775,16 @@ } break;



More information about the Python-Dev mailing list