Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #55154
| Path | csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.001 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'algorithm': 0.04; 'tree': 0.05; '*not*': 0.07; 'binary': 0.07; 'detect': 0.07; 'made.': 0.07; 'calls.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'def': 0.12; 'jan': 0.12; '"good': 0.16; 'args:': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:Programming': 0.16; 'subject:python': 0.16; 'followed': 0.16; 'weird': 0.16; 'wrote:': 0.18; "python's": 0.19; 'things.': 0.19; '(in': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'byte': 0.24; 'instance,': 0.24; 'right.': 0.26; 'this:': 0.26; 'primary': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In- Reply-To:1': 0.27; 'function': 0.29; 'points': 0.29; 'tim': 0.29; "i'm": 0.30; 'code': 0.31; '(since': 0.31; 'chase': 0.31; 'omitted': 0.31; 'trivial': 0.31; 'call.': 0.33; 'implemented': 0.33; 'programmers': 0.33; 'could': 0.34; 'info': 0.35; 'something': 0.35; 'but': 0.35; 'crazy': 0.36; 'example,': 0.37; 'two': 0.37; 'level': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'delete': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'called': 0.40; 'skip:u 10': 0.60; 'algorithms': 0.60; 'expression': 0.60; 'took': 0.61; 'received:173': 0.61; 'making': 0.63; 'hearing': 0.63; 'name': 0.63; 'become': 0.64; 'containing': 0.69; 'balanced': 0.84; 'calls,': 0.84; 'divide': 0.84; 'optimized.': 0.84; 'received:fios.verizon.net': 0.84; '2013,': 0.91 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | Terry Reedy <tjreedy@udel.edu> |
| Subject | Re: Functional Programming and python |
| Date | Mon, 30 Sep 2013 21:03:41 -0400 |
| References | <b1a0acc2-b6e6-41c2-941c-9e9ccde1abb1@googlegroups.com> <CAPM-O+w=wGf2ZxezQj5Mccrx_mDsgtxxKNtmL4GhDn_x3ty2Rw@mail.gmail.com> <mailman.170.1375562619.1251.python-list@python.org> <c45c6fe3-b79c-4d14-9c89-b462808d7e32@googlegroups.com> <ba94102b-18b6-4850-ac85-032b0fe2fa75@googlegroups.com> <nobody-C700FA.19043230092013@news.free.fr> <20130930160218.326d518b@bigbox.christie.dr> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Gmane-NNTP-Posting-Host | pool-173-75-251-66.phlapa.fios.verizon.net |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.0 |
| In-Reply-To | <20130930160218.326d518b@bigbox.christie.dr> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.527.1380589440.18130.python-list@python.org> (permalink) |
| Lines | 45 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1380589440 news.xs4all.nl 15938 [2001:888:2000:d::a6]:36955 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:55154 |
Show key headers only | View raw
On 9/30/2013 5:02 PM, Tim Chase wrote: > On 2013-09-30 19:04, Franck Ditter wrote: >> two points make me crazy : >> 1. Tail recursion is not optimized. We are in 2013, why ? This is >> known technology (since 1960). And don't answer with "good >> programmers don't use recursion", > > I seem to recall hearing that the primary reason it hadn't been > implemented is because of Python's super-dynamism (to make up a > word). Right. A tail call is a call immediately followed by a return (in the byte code or equivalent). A recursive tail call is a tail call to the function containing the tail call. In Python, the function to be called in a call is not determined until the call is made. This is because the function expression is evaluated to a function object at runtime, not when the function is compiled. It would be trivial to detect and somewhat optimize all tail calls in CPython. But the result would be to delete traceback info with *all* tail calls, not just for recursive tail calls. Some functions have multiple recursive calls, as with divide and conquer algorithms and graph traversal. The last recursive call might or might not be a tail call. When it is, having calls omitted from the traceback might be undesireable. It might be disconcerting, for instance, if the number of calls in the traceback for a balanced binary tree algorithm did *not* match the level where the error took place. > That a function could be a tail recursion in one call, but > the calling the same name could then become rebound. I'm making up > the example, but I think it was something like this: > > def kablooie(*args): > if not args: > def kablooie(*args): > woah() > do_something(args) > kablooie(args[1:]) > > where tail recursion optimization would do weird things. -- Terry Jan Reedy
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Where to suggest improvements in the official Python documentation? Aseem Bansal <asmbansal2@gmail.com> - 2013-08-03 10:53 -0700
Re: Where to suggest improvements in the official Python documentation? Joel Goldstick <joel.goldstick@gmail.com> - 2013-08-03 14:23 -0400
Re: Where to suggest improvements in the official Python documentation? Terry Reedy <tjreedy@udel.edu> - 2013-08-03 16:43 -0400
Re: Where to suggest improvements in the official Python documentation? Aseem Bansal <asmbansal2@gmail.com> - 2013-08-04 09:30 -0700
Re: Where to suggest improvements in the official Python documentation? Joel Goldstick <joel.goldstick@gmail.com> - 2013-08-04 14:34 -0400
Re: Where to suggest improvements in the official Python documentation? Aseem Bansal <asmbansal2@gmail.com> - 2013-08-20 07:22 -0700
Re: Where to suggest improvements in the official Python documentation? Joel Goldstick <joel.goldstick@gmail.com> - 2013-08-20 10:57 -0400
Functional Programming and python rusi <rustompmody@gmail.com> - 2013-09-22 19:21 -0700
Re: Functional Programming and python Vito De Tullio <vito.detullio@gmail.com> - 2013-09-23 20:24 +0200
Re: Functional Programming and python Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-09-24 10:06 +0300
Re: Functional Programming and python rusi <rustompmody@gmail.com> - 2013-09-24 00:08 -0700
Re: Functional Programming and python Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-09-24 10:42 +0300
Re: Functional Programming and python rusi <rustompmody@gmail.com> - 2013-09-24 05:14 -0700
Re: Functional Programming and python Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-09-24 17:51 +0300
Re: Functional Programming and python rusi <rustompmody@gmail.com> - 2013-09-24 08:07 -0700
Re: Functional Programming and python Chris Angelico <rosuav@gmail.com> - 2013-09-25 01:26 +1000
Re: Functional Programming and python rusi <rustompmody@gmail.com> - 2013-09-24 10:25 -0700
Re: Functional Programming and python Franck Ditter <nobody@nowhere.org> - 2013-09-30 19:04 +0200
Re: Functional Programming and python Chris Angelico <rosuav@gmail.com> - 2013-10-01 03:17 +1000
Re: Functional Programming and python Neil Cerutti <neilc@norwich.edu> - 2013-09-30 18:36 +0000
Re: Functional Programming and python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-01 00:14 +0000
Re: Functional Programming and python Neil Cerutti <neilc@norwich.edu> - 2013-10-01 13:59 +0000
Re: Functional Programming and python Piet van Oostrum <piet@vanoostrum.org> - 2013-09-30 14:55 -0400
Re: Functional Programming and python Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-09-30 22:37 +0200
Re: Functional Programming and python Piet van Oostrum <piet@vanoostrum.org> - 2013-10-01 13:31 -0400
Re: Functional Programming and python Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-09-30 20:29 +0200
Re: Functional Programming and python Tim Chase <python.list@tim.thechases.com> - 2013-09-30 16:02 -0500
Re: Functional Programming and python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-01 00:41 +0000
Re: Functional Programming and python alex23 <wuwei23@gmail.com> - 2013-10-01 11:03 +1000
Re: Functional Programming and python Terry Reedy <tjreedy@udel.edu> - 2013-09-30 21:03 -0400
Re: Functional Programming and python rusi <rustompmody@gmail.com> - 2013-09-30 18:36 -0700
Re: Functional Programming and python Chris Angelico <rosuav@gmail.com> - 2013-10-01 17:28 +1000
csiph-web