[IPython-dev] A cool python recipe - maybe useful for ipython

Ville Vainio vivainio at gmail.com
Mon May 15 02:31:27 EDT 2006


On 5/15/06, Fernando Perez <fperez.net at gmail.com> wrote:

> It would be a lot more useful if this were something that ipython
> could do for you, regardless of whether the underlying object had
> implemented it.
>
> If some enterprising soul wants a stab at this, it can be initially
> (for testing) done as a custom exception handler, which fires on all
> AttributeErrors.  It can then implement this kind of introspection
> /after/ the error has fired, without introducing any overhead at
> runtime.
>
> Note that doing this isn't totally trivial: you'll have the exception
> and the stack, but identifying the offending object is something which
> I'm not really sure how to do.

Also, w/ ipython it's slightly less useful because of tab completion.
I hardly ever type method names w/o pressing tab, and hence almost
never get AttributeError's in the first place...

-- 
Ville Vainio - vivainio.googlepages.com
vainio.blogspot.com - g[mail | talk]='vivainio'




More information about the IPython-dev mailing list