Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #90689
| References | <871tih66z5.fsf@Equus.decebal.nl> <2c2b0f1d-ce16-41b4-a12d-1cface2bf154@googlegroups.com> |
|---|---|
| Date | 2015-05-15 14:14 -0500 |
| Subject | Re: Minimising stack trace |
| From | Skip Montanaro <skip.montanaro@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.46.1431717256.17265.python-list@python.org> (permalink) |
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 | Next — Previous in thread | Next in thread | Find similar | Unroll 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