<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On May 21, 2014, at 1:21 PM, <a href="mailto:python-ideas-request@python.org">python-ideas-request@python.org</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span style="font-family: ArialMT; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"><span class="Apple-converted-space"> </span> I propose that we add a way to completely disable the<span class="Apple-converted-space"> </span></span><br style="font-family: ArialMT; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: ArialMT; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">optimizer.</span><br style="font-family: ArialMT; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></blockquote></div><br><div>I think this opens a can of worms that is better left closed.</div><div><br></div><div>* We will have to start running tests both with and without the switch</div><div>turned on for example (because you're exposing yet another way to</div><div>run Python with different code).</div><div><br></div><div>* Over time, I expect that some of the functionality of the peepholer</div><div>is going to be moved upstream into AST transformations you will</div><div>have even less ability switch something on-and-off. </div><div><br></div><div>* The code in-place has been in the code for over a decade and</div><div>the tracker item has languished for years. That provides some</div><div>evidence that the "need" here is very small.</div><div><br></div><div>* I sympathize with "there is an irritating dimple in coverage.py"</div><div>but that hasn't actually impaired its usability beyond creating a</div><div>curiosity. Using that a reason to add a new CPython-only</div><div>command-line switch seems like having the tail wag the dog.</div><div><br></div><div>* As the other implementations of Python continue to develop,</div><div>I don't think we should tie their hands with respect to code</div><div>generation.</div><div><br></div><div>* Ideally, the peepholer should be thought of as part of the code</div><div>generation. As compilation improves over time, it should start</div><div>to generate the same code as we're getting now. It probably</div><div>isn't wise to expose the implementation detail that the constant</div><div>folding and jump tweaks are done in a separate second pass.</div><div><br></div><div>* Mostly, I don't want to open a new crack in the Python veneer</div><div>where people are switching on and off two different streams of</div><div>code generation (currently, there is one way to do it). I can't</div><div>fully articulate my instincts here, but I think we'll regret opening</div><div>this door when we didn't have to.</div><div><br></div><div>That being said, I know how the politics of python-ideas works</div><div>and I expect that my thoughts on the subject will quickly get</div><div>buried by a discussion of which lettercode should be used for the</div><div>command-line switch.</div><div><br></div><div>Hopefully, some readers will focus on the question of whether</div><div>it is worth it. Others might look at ways to improve the existing</div><div>code (without an off-switch) so that the continue-statement</div><div>jump-to-jump shows-up in your coverage tool.</div><div><br></div><div>IMO, adding a new command-line switch is a big deal (we should</div><div>do it very infrequently, limit it to things with a big payoff, and </div><div>think about whether there are any downsides). Personally, I don't</div><div>see any big wins here and have a sense that there are downsides</div><div>that would make us regret exposing alternate code generation.</div><div><br></div><div><br></div><div>Raymond</div><div><br></div><div><br></div><div><br></div><div><br></div></body></html>