Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:not': 0.03; 'anyway.': 0.05; 'guido': 0.05; 'subject:Python': 0.06; 'abuse': 0.07; 'debugging.': 0.09; 'naturally': 0.09; 'optimizing': 0.09; 'python': 0.11; 'abusing': 0.16; 'iteration': 0.16; 'said.': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'replace': 0.24; "shouldn't": 0.24; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'chris': 0.29; 'am,': 0.29; 'converting': 0.30; 'strongly': 0.30; 'code': 0.31; 'maintaining': 0.32; 'actively': 0.33; 'could': 0.34; 'really': 0.36; 'should': 0.36; 'implement': 0.38; 'to:addr :python-list': 0.38; 'rather': 0.38; 'anything': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'simple,': 0.60; "you're": 0.61; 'charset:windows-1252': 0.65; 'optimized': 0.68; 'received:74.208': 0.68; 'integrity': 0.74; 'manner.': 0.74; 'recursion,': 0.84 Date: Sat, 02 May 2015 06:22:20 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Python is not bad ;-) References: <87mw1q9jqw.fsf@Equus.decebal.nl> <87383hj4zj.fsf@elektro.pacujo.net> <87d22lx38x.fsf@Equus.decebal.nl> <55432557$0$12994$c3e8da3$5496439d@news.astraweb.com> <87383fo062.fsf@Equus.decebal.nl> <87egmzl4yr.fsf@elektro.pacujo.net> <87a8xnl2r6.fsf@elektro.pacujo.net> In-Reply-To: <87a8xnl2r6.fsf@elektro.pacujo.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:8VjQO6kuczEUKdZt3XGqDB86eTibwfbrbE/Alm6S3QCB5krWl1r AkiwRqANzSiTCpzsPZ9zTSOQ5rMp1TzpvKbSDW/Byqiy7v8oyo9LHKNP7bXltKSm8WWWmBx EF3aP8t4jQOEZJ/tlowlvLslNkQTYfliJSZKSA1Xkz1MHJ6xM9TPfmPq2w4eMcXz6mvXrxg WPlHy19Gf7MzKGw95W0cw== X-UI-Out-Filterresults: notjunk:1; X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1430562152 news.xs4all.nl 2845 [2001:888:2000:d::a6]:33110 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:89756 On 05/02/2015 05:58 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> Guido is against anything that disrupts tracebacks, and optimizing >> tail recursion while maintaining traceback integrity is rather harder. > > Tail recursion could be suppressed during debugging. Optimized code can > play all kinds of non-obvious tricks with the execution frame. > >> In the situations where it really is simple, you can always make the >> change in your own code anyway. Often, the process of converting >> recursion into tail recursion warps the code to the point where it's >> abusing recursion to implement iteration anyway, so just make it >> iterative. > > While you shouldn't actively replace Python iteration with recursion, I > strongly disagree that naturally occurring tail recursion is abuse or > should be avoided in any manner. > When you strongly disagree, make sure you're disagreeing with what Chris actually said. The key phrase in his message was "converting recursion into tail recursion" NOT "converting iteration into recursion" and NOT "naturally occurring tail recursion" -- DaveA