Author tim.peters
Recipients aldwinaldwin, lukasz.langa, miss-islington, ned.deily, nedbat, p-ganssle, pablogsal, serhiy.storchaka, terry.reedy, tim.peters, xtreak
Date 2019-07-06.00:05:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> Using jumps is not removing the optimization
> entirely, is just a weaker and more incomplete
> way of doing the same. 

Sorry, I'm afraid I have no idea what that means.  The generated code before and after was wildly different, as shown in Ned's original report here.  In what possible sense was his "if 0:" being "optimized" if it generated code to load 0 onto the stack, then POP_JUMP_IF_FALSE, and then jumped over all the code generated for the dead block?

The generated code after is nearly identical if I replace his "if 0:" with "if x:" (which the compiler takes to mean a global or builtin about whose truthiness it knows nothing at all).  Indeed, the only difference in the byte code is that instead of doing a LOAD_CONST to load 0, it does a LOAD_GLOBAL to load x.

So, to my eyes, absolutely nothing of the optimization remained.  At least not in the example Ned posted here.
Date User Action Args
2019-07-06 00:05:56tim.peterssetrecipients: + tim.peters, terry.reedy, nedbat, ned.deily, lukasz.langa, serhiy.storchaka, p-ganssle, pablogsal, miss-islington, xtreak, aldwinaldwin
2019-07-06 00:05:56tim.peterssetmessageid: <>
2019-07-06 00:05:56tim.peterslinkissue37500 messages
2019-07-06 00:05:55tim.peterscreate