[Python-Dev] Twisted Isn't Specific (was Re: Trial balloon: microthreads library in stdlib)
A.M. Kuchling
amk at amk.ca
Thu Feb 15 16:46:05 CET 2007
On Thu, Feb 15, 2007 at 09:19:30AM -0500, Jean-Paul Calderone wrote:
> >That feels like 6 layers too many, given that
> > _logrun(selectable, _drdw, selectable, method, dict)
> > return context.call({ILogContext: newCtx}, func, *args, **kw)
> > return self.currentContext().callWithContext(ctx, func, *args, **kw)
> > return func(*args, **kw)
> > getattr(selectable, method())
> > klass(number, string)
> >
> >are all generic calls.
>
> I know function calls are expensive in Python, and method calls even more
> so... but I still don't understand this issue. Twisted's call stack is too
> deep? It is fair to say it is deep, I guess, but I don't see how that is a
> problem. If it is, I don't see how it is specific to this discussion.
It's hard to debug the resulting problem. Which level of the *12*
levels in the stack trace is responsible for a bug? Which of the *6*
generic calls is calling the wrong thing because a handler was set up
incorrectly or the wrong object provided? The code is so 'meta' that
it becomes effectively undebuggable.
--amk
More information about the Python-Dev
mailing list