Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!news2.arglkargh.de!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: Python is not bad ;-) Date: Sat, 02 May 2015 12:58:37 +0300 Organization: A noiseless patient Spider Lines: 20 Message-ID: <87a8xnl2r6.fsf@elektro.pacujo.net> 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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="ff5cf27ef3d5b31f034d3b72bdc27a41"; logging-data="12535"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Eg7o4ujStXKfxNA9nQlme" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:G8US9QiFfOO1TRFej1EFRYs4dZ4= sha1:iv6QI90OFuPBLvScrb/+XJrlTIg= Xref: csiph.com comp.lang.python:89754 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. Marko