Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed7.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '16,': 0.03; 'stack.': 0.07; 'cc:addr:python-list': 0.09; 'debugger': 0.09; 'exception,': 0.09; 'frameworks,': 0.09; 'stderr': 0.09; '(at': 0.13; 'exception': 0.13; 'stack': 0.13; 'thu,': 0.15; 'variables': 0.15; 'clear.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'himself.': 0.16; 'py3': 0.16; 'stack:': 0.16; 'sure.': 0.16; 'useless.': 0.16; 'wrote:': 0.16; 'debugging': 0.18; 'say,': 0.18; '>>>': 0.20; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'fine,': 0.22; 'trace': 0.22; 'code.': 0.23; "haven't": 0.24; 'header:In-Reply-To:1': 0.24; "doesn't": 0.26; 'example': 0.26; 'chris': 0.26; 'message- id:@mail.gmail.com': 0.27; 'values': 0.28; 'tail': 0.29; 'subject:/': 0.30; 'code': 0.30; 'generally': 0.32; 'point': 0.33; 'useful': 0.33; 'lets': 0.33; 'traceback': 0.33; 'info': 0.34; 'received:google.com': 0.35; 'next': 0.35; 'done': 0.35; 'level': 0.35; 'should': 0.36; 'tool': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'someone': 0.38; 'sure': 0.39; 'whatever': 0.39; 'application': 0.39; 'some': 0.40; 'more': 0.63; 'grab': 0.64; 'jul': 0.72; 'actually,': 0.84; 'chrisa': 0.84; 'locals': 0.84; 'pardon': 0.84; 'to:none': 0.91; 'drops': 0.91 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=s3qI4LPul23v5PB30FktmLDDbwMFm9fCbADYXt+vKFs=; b=R0UYymAFZksFaChydpslGNoFmDCVhPNADKLuhina1pNuDwFYftWgrGfFQr+Us9UfDj +Sdy+Ykd8DTEgb2jVvuBRnw/2gN0Pw8MA5cA7M4nEl98C9xgb3lQhQKnG6asp3ot73GS XccBqQlHubJfGSf1wx+V1C6A387vQqTP/HW6GP1cXcFtqv9LlZONbV6ba3HtcmQ9LlJI UOuVdzwVA6AW7tAW6+WNf1vwUYgQr4jrXn6mRepazNORFnDRGTxwcGOz+tUtksMkvbmn t8j9TpAUDL4PDC7EbDVlwamqz50YJkSdKR8J17sfENgc5bVfgEe9Faxi2xoWikuv2ez3 Ghew== MIME-Version: 1.0 X-Received: by 10.50.36.72 with SMTP id o8mr4274965igj.16.1437055206230; Thu, 16 Jul 2015 07:00:06 -0700 (PDT) In-Reply-To: <55A7B80B.6090905@rece.vub.ac.be> References: <55A3A853.4040006@rece.vub.ac.be> <55A3C366.6060602@rece.vub.ac.be> <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> Date: Fri, 17 Jul 2015 00:00:05 +1000 Subject: Re: Possibly Pythonic Tail Call Optimization (TCO/TRE) 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: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1437055215 news.xs4all.nl 2836 [2001:888:2000:d::a6]:39184 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:93929 On Thu, Jul 16, 2015 at 11:56 PM, Antoon Pardon wrote: > On 07/16/2015 01:45 PM, Chris Angelico wrote: >> On Thu, Jul 16, 2015 at 5:31 PM, Antoon Pardon >> wrote: >>> >>> I would say, that someone should get over himself. >>> Traceback are not the only or even the most useful >>> tool for debugging code. The current stack trace >>> doesn't even contain the value's of the variables >>> on the stack. So in case of Terry Reedy's example >>> that stack trace would IMO have been next to useless. >> Actually, they do contain all of that (at least, they do in Py3 - not >> sure about Py2 as I haven't checked). You can poke around with the >> locals at every point on the stack: > > Fine, I should have been more clear. > > The stack trace as it is generally produced on stderr after an uncought > exception, doesn't contain the values of the variables on the stack. Sure. So you catch it at top level and grab whatever info you need. In some frameworks, this is already done for you - an uncaught exception from application code drops you into a debugger that lets you explore and even execute code at any level in the stack. This would be destroyed by automated tail call optimization. ChrisA