New generic inspect_object

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

New generic inspect_object

Ville M. Vainio
I just checked in a new generic function "inspect_object".

Basically, you can use it to customize how your objects are displayed
when you do

obj?

or

obj??

Hypothetical examples: a "path" object could launch an explorer window
in the directory if the path points to a directory, an image object
could launch a window displaying the image etc. etc.

Modern syntax would be:

@IPython.generics.inspect_object.when_type(path)
def my_display(obj):
  print "Inspecting",obj

--
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'
_______________________________________________
IPython-dev mailing list
[hidden email]
http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev