Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!bcyclone03.am1.xlned.com!bcyclone03.am1.xlned.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!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; 'debugging.': 0.07; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'specifying': 0.09; 'stack': 0.13; 'useful,': 0.13; 'explicitly': 0.15; 'dropping': 0.16; 'frame,': 0.16; 'quoted': 0.16; 'wrote:': 0.16; 'frameworks': 0.18; 'mechanism': 0.18; 'programmer': 0.18; 'variable': 0.18; 'trace': 0.22; 'am,': 0.23; 'somewhere': 0.24; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'chris': 0.26; 'helpful': 0.27; 'said,': 0.27; 'assembly': 0.29; 'thread,': 0.29; '~ethan~': 0.29; 'subject:/': 0.30; "can't": 0.32; 'says': 0.32; 'good.': 0.32; 'though,': 0.32; 'maybe': 0.33; 'adjust': 0.33; 'traceback': 0.33; 'true.': 0.33; 'could': 0.35; 'but': 0.36; 'there': 0.36; 'possible': 0.36; 'keyword': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'setting': 0.37; 'say': 0.37; "won't": 0.38; 'drop': 0.38; 'to:addr:python.org': 0.40; 'called': 0.40; 'some': 0.40; 'show': 0.62; 'charset:windows-1252': 0.62; 'more': 0.63; 'information': 0.63; 'received:10.1.10': 0.84; 'stronger.': 0.84 Date: Thu, 16 Jul 2015 10:04:26 -0700 From: Ethan Furman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Possibly Pythonic Tail Call Optimization (TCO/TRE) References: <87fv4r1fre.fsf@jester.gateway.sonic.net> <87bnff1eks.fsf@jester.gateway.sonic.net> <87d1zunctp.fsf@elektro.pacujo.net> <87k2u2eu67.fsf@elektro.pacujo.net> <55A51662.4090007@rece.vub.ac.be> <55A75DE0.1070101@rece.vub.ac.be> <55A7B80B.6090905@rece.vub.ac.be> <55A7C094.7060604@rece.vub.ac.be> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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: 1437066280 news.xs4all.nl 2888 [2001:888:2000:d::a6]:46739 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 4924 X-Received-Body-CRC: 1834890952 Xref: csiph.com comp.lang.python:93938 On 07/16/2015 09:43 AM, Chris Angelico wrote: > True. That said, though, it's not a justification for dropping stack > frames; even in the form that's printed to stderr, there is immense > value in them. It may be possible to explicitly drop frames that a > programmer believes won't be useful, but a general and automated > dropping of tail-call information will do more harm than good. The > fact that some frameworks can show _even more_ helpful information out > of a traceback only makes this stronger. If we had a general mechanism then we would also need to have a setting somewhere so we could adjust which frames to keep when debugging. I must say I don't see much value in a stack trace that says a called b called c called a called b called c called a called ... -- particularly when the line quoted has only the variable names, not their values, so you can't see what's changing. Of this whole thread, though, I like the 'recurse' keyword proposal best -- I have no issues with the programmer specifying when to ditch the stack frame, but maybe that's my assembly roots showing. ;) -- ~Ethan~