[IPython-user] [Python-Dev] a quit that actually quits

Fernando Perez Fernando.Perez at colorado.edu
Wed Jan 4 01:11:23 CST 2006

Walter Dörwald wrote:

> A solution that would work uniformly for all hooks would be to have the 
> hook raise an exception when it doesn't know how to handle an object or 
> request and wants to defer to the next hook in line:
> @asdisplayhook
> def inthook(obj):
>     if isinstance(obj, int):
>        print "%d (0%o, 0x%x)" % (obj, obj, obj)
>     else:
>        raise TryNextHook

Interesting approach.  I've jotted it down in the wiki for future reference, 
for when we actually get around to working on this implementation-wise.



More information about the IPython-user mailing list