Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #90689

Re: Minimising stack trace

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 <skip.montanaro@gmail.com>
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 <skip.montanaro@gmail.com>
To Ned Batchelder <ned@nedbatchelder.com>
Cc Python <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 <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.46.1431717256.17265.python-list@python.org> (permalink)
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

Show key headers only | View raw


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 <ned@nedbatchelder.com> 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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Minimising stack trace Cecil Westerhof <Cecil@decebal.nl> - 2015-05-15 20:17 +0200
  Re: Minimising stack trace Ned Batchelder <ned@nedbatchelder.com> - 2015-05-15 12:04 -0700
    Re: Minimising stack trace Skip Montanaro <skip.montanaro@gmail.com> - 2015-05-15 14:14 -0500
    Re: Minimising stack trace Cecil Westerhof <Cecil@decebal.nl> - 2015-05-16 09:22 +0200
  Re: Minimising stack trace Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-05-15 21:41 +0200
    Re: Minimising stack trace Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-16 10:57 +1000
      Re: Minimising stack trace Ned Batchelder <ned@nedbatchelder.com> - 2015-05-15 18:24 -0700
        Re: Minimising stack trace Chris Angelico <rosuav@gmail.com> - 2015-05-16 11:33 +1000
          Re: Minimising stack trace Ned Batchelder <ned@nedbatchelder.com> - 2015-05-15 18:37 -0700
        Re: Minimising stack trace Rustom Mody <rustompmody@gmail.com> - 2015-05-15 19:51 -0700
          Re: Minimising stack trace Rustom Mody <rustompmody@gmail.com> - 2015-05-15 19:59 -0700
          Re: Minimising stack trace Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-05-16 04:49 +0100
  Re: Minimising stack trace Cecil Westerhof <Cecil@decebal.nl> - 2015-05-16 15:49 +0200

csiph-web