Minimising stack trace

Ned Batchelder ned at nedbatchelder.com
Fri May 15 21:37:05 EDT 2015


On Friday, May 15, 2015 at 9:33:54 PM UTC-4, Chris Angelico wrote:
> On Sat, May 16, 2015 at 11:24 AM, Ned Batchelder <ned at nedbatchelder.com> wrote:
> > On Friday, May 15, 2015 at 8:57:53 PM UTC-4, Steven D'Aprano wrote:
> >> On Sat, 16 May 2015 05:41 am, Thomas 'PointedEars' Lahn wrote:
> >>
> >> > 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.
> >> >
> >> > <http://www.catb.org/~esr/faqs/smart-questions.html>
> >>
> >> There ought to be a website that explains how to give smart answers.
> >
> > Or one that explains how to be kind to those that don't know
> > the ropes yet.  Though pointing impatient experts at a
> > website probably won't get them to change any more than
> > brusquely pointing newbs at a website will.
> 
> You mean like this?
> 
> http://www.catb.org/~esr/faqs/smart-questions.html#idp64834912
> 
> (Not sure whether you knew and were hinting, or didn't know that
> that's explicitly mentioned.)

I didn't realize that was in there. :) It's a good demonstration
that we can all improve in various ways.  Being right isn't the
highest ideal, there are other things to aspire to as well.

--Ned.



More information about the Python-list mailing list