From c6bcbb58982e519b446b363a4a73b0e750ad5d39 Mon Sep 17 00:00:00 2001 From: "Bradley M. Froehle" Date: Sun, 4 Dec 2011 00:04:57 -0800 Subject: [PATCH] Show class init and call tooltips in notebook. Closes #1094. --- .../frontend/html/notebook/static/js/codecell.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/IPython/frontend/html/notebook/static/js/codecell.js b/IPython/frontend/html/notebook/static/js/codecell.js index 8ca5eb6e321..971a1c9c728 100644 --- a/IPython/frontend/html/notebook/static/js/codecell.js +++ b/IPython/frontend/html/notebook/static/js/codecell.js @@ -162,9 +162,16 @@ var IPython = (function (IPython) { } CodeCell.prototype.finish_tooltip = function (reply) { - defstring=reply.definition; - docstring=reply.docstring; - if(docstring == null){docstring=""}; + // Extract call tip data; the priority is call, init, main. + defstring = reply.call_def; + if (defstring == null) { defstring = reply.init_definition; } + if (defstring == null) { defstring = reply.definition; } + + docstring = reply.call_docstring; + if (docstring == null) { docstring = reply.init_docstring; } + if (docstring == null) { docstring = reply.docstring; } + if (docstring == null) { docstring = ""; } + name=reply.name; var that = this;