Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed2a.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:not': 0.03; 'anyway.': 0.05; 'cpython': 0.05; 'guido': 0.05; 'subject:Python': 0.06; 'optimizing': 0.09; 'cc:addr:python-list': 0.11; 'language.': 0.14; 'thread': 0.14; "wouldn't": 0.14; 'abusing': 0.16; 'already,': 0.16; 'eliminating': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'fruit': 0.16; 'fruit.': 0.16; 'iteration': 0.16; 'sat,': 0.16; 'language': 0.16; 'wrote:': 0.18; 'programming': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'converting': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'maintaining': 0.32; 'received:google.com': 0.35; 'really': 0.36; 'scheme': 0.36; 'sequence': 0.36; 'should': 0.36; 'implement': 0.38; 'pm,': 0.38; 'rather': 0.38; 'anything': 0.39; 'even': 0.60; 'simple,': 0.60; 'mentioned': 0.61; 'such': 0.63; 'pick': 0.64; 'note:': 0.66; 'integrity': 0.74; '2015': 0.84; 'actually,': 0.84; 'fibonacci': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=5G4f1OaQxwZtl599ZqxoY17N21DCoaXEoxqKojwbVfw=; b=ZKASCi2wgjHiZu+XEIMZLbEgvEOl+DhyfgDxTUjEasaMESidApeg9YogDCJz6b22iu 8p2/0iSHBzxASRvBVa4EFrU9VEXkZgvKy6c1NCz9uNEPqDb0jsTVwNtAYvigRk/o7Pub G2oCBiO36l7lP06tMxm1Uw/vr2pxp4GyekNkiL94JXvIcrfxvW2SBdHHhZmpnQWVBtZF PWHjhXpdS4kCare0DbCO95pyo1Q3B5RaJHYOpE65PPeJ9d18Sm/lJWGsVPppSEiMTFrk QBjBBlpjdlzfFiHkUxkqbMTfLSlgLVuMd1YkjKDXY1/tZF6TmP6ZHJdshFZXOwfXYzEC hLUw== MIME-Version: 1.0 X-Received: by 10.50.176.137 with SMTP id ci9mr2457011igc.2.1430558711326; Sat, 02 May 2015 02:25:11 -0700 (PDT) In-Reply-To: <87egmzl4yr.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> Date: Sat, 2 May 2015 19:25:11 +1000 Subject: Re: Python is not bad ;-) From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1430558719 news.xs4all.nl 2890 [2001:888:2000:d::a6]:39871 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:89753 On Sat, May 2, 2015 at 7:10 PM, Marko Rauhamaa wrote: > Note: Scheme is my favorite language and I use tail recursion all the > time. I also think eliminating tail recursion is such a low-hanging > fruit that even CPython should just pick it. However, I wouldn't use the > fibonacci sequence to justify anything at all about a programming > language. Actually, it isn't such low-hanging fruit. As has been mentioned in this thread already, Guido is against anything that disrupts tracebacks, and optimizing tail recursion while maintaining traceback integrity is rather harder. 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. ChrisA