X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 78.192.65.63 Path: csiph.com!usenet.pasdenom.info!nntpfeed.proxad.net!news.muarf.org!news.roellig-ltd.de!open-news-network.org!border2.nntp.ams1.giganews.com!nntp.giganews.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: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.095 X-Spam-Evidence: '*H*': 0.81; '*S*': 0.00; 'friday,': 0.09; 'cc:addr :python-list': 0.11; 'losing': 0.16; 'shorten': 0.16; 'trace.': 0.16; 'wrote:': 0.18; 'stack': 0.19; 'import': 0.22; 'cc:addr:python.org': 0.22; 'skip': 0.24; 'cc:2**0': 0.24; '15,': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'lines': 0.31; 'comparison': 0.31; 'depth': 0.31; 'helpful.': 0.31; 'produces': 0.31; 'option': 0.32; 'another': 0.32; 'url:python': 0.33; 'fri,': 0.33; 'third': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'shorter': 0.36; 'url:listinfo': 0.36; 'url:org': 0.36; 'example,': 0.37; 'pm,': 0.38; 'url:mail': 0.40; 'length': 0.61; 'you.': 0.62; 'information': 0.63; 'maximum': 0.63; 'increase': 0.74; '2015': 0.84; 'batchelder': 0.84; 'exceeded': 0.97 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:to :cc:content-type; bh=jq717c7LKyqZbKPIfgln/kH8doUpAUEzdPcu+bDBNdw=; b=gWGSzlxlOWE/4hZFNDlcQRitCb8ETd0x+8r1TdIaaXHNzqh8Jf73LzMqUOBkgEB/3U E5V7svrtp/B7/iJwV+VGxp8zAk1LpES2nLFmKZVn2CNjJhb9BH4jzUiCCXzg97QxeHfe zjzl24UUcPdJhzOCahC+owZgsoA2NvUbIp6LNgpP2vSI3UCx7MIscCZTF2qX2ORAs8f1 G/T2yhqrGp5e1MsZ6lJf1UuAECv/k+SbgEjhbh2LOEyvD8oeJeqjh3UqiPm8WAAEgGil hk5X3moemEPztalcgFe7QufRkPvFRzfb7gHzHalOLLLuWCLk/7SraLmQaGUcYYdFVfbA FvoQ== MIME-Version: 1.0 X-Received: by 10.60.35.42 with SMTP id e10mr9545409oej.26.1431717248041; Fri, 15 May 2015 12:14:08 -0700 (PDT) In-Reply-To: <2c2b0f1d-ce16-41b4-a12d-1cface2bf154@googlegroups.com> References: <871tih66z5.fsf@Equus.decebal.nl> <2c2b0f1d-ce16-41b4-a12d-1cface2bf154@googlegroups.com> Date: Fri, 15 May 2015 14:14:07 -0500 Subject: Re: Minimising stack trace From: Skip Montanaro To: Ned Batchelder Cc: Python 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: 1431717256 news.xs4all.nl 2852 [2001:888:2000:d::a6]:45399 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:90689 A third alternative is to take a look at asyncore.compact_traceback. That will only help modestly in Cecil's example, but I found it helpful. Skip On Fri, May 15, 2015 at 2:04 PM, Ned Batchelder wrote: > On Friday, May 15, 2015 at 2:50:12 PM UTC-4, Cecil Westerhof wrote: >> While playing with recursion I get: >> RuntimeError: maximum recursion depth exceeded in comparison >> >> But then I get a very long stack trace. Is there a way to make this a >> lot shorter. Now I 'lose' interesting information because of the >> length of the stack trace. > > There isn't a way to shorten the stack trace. If you are losing > information at the top because of your terminal window, you can > likely increase the number of lines it will keep for you. > > Another option is to reduce the maximum stack depth, so that it > is exceeded sooner, which produces shorter stack traces: > > import sys; > sys.setrecursionlimit(50) > > > --Ned. > -- > https://mail.python.org/mailman/listinfo/python-list