classification
Title: CallTips.py _find_constructor does not work
Type: behavior Stage: test needed
Components: IDLE Versions: Python 3.3, Python 3.2, Python 3.1
process
Status: open Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Bernt.Røskar.Brenna, brian.curtin, roger.serwy, terry.reedy
Priority: normal Keywords:

Created on 2010-02-08 12:11 by Bernt.Røskar.Brenna, last changed 2012-07-10 03:30 by roger.serwy.

Files
File name Uploaded Description Edit
test_idlelib.py Bernt.Røskar.Brenna, 2011-12-22 08:44
Messages (5)
msg99043 - (view) Author: Bernt Røskar Brenna (Bernt.Røskar.Brenna) Date: 2010-02-08 12:11
Test case:

In IDLE python shell:
>>> from http.client import HTTPConnection
>>> c = HTTPConnection(

Notice that the call tip is an empty parenthesis.

This patch works for me:

[/tmp/py3k/Lib/idlelib]
$ svn diff
Index: CallTips.py
===================================================================
--- CallTips.py (revision 78103)
+++ CallTips.py (working copy)
@@ -116,7 +116,7 @@
 def _find_constructor(class_ob):
     "Find the nearest __init__() in the class tree."
     try:
-        return class_ob.__init__.__func__
+        return class_ob.__init__
     except AttributeError:
         for base in class_ob.__bases__:
             init = _find_constructor(base)
msg99048 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-02-08 15:47
That change works for me.
msg150047 - (view) Author: Roger Serwy (roger.serwy) * (Python committer) Date: 2011-12-21 21:50
The patch works for me as well against 3.3a0. 

Are there any cases where "__init__.__func__" would work?
msg150079 - (view) Author: Bernt Røskar Brenna (Bernt.Røskar.Brenna) Date: 2011-12-22 08:44
Attached is Lib/test/test_idlelib.py, containing a unit test for the issue.
msg165151 - (view) Author: Roger Serwy (roger.serwy) * (Python committer) Date: 2012-07-10 03:30
Issue12510 fixes the issues listed here. I am leaving this issue open for discussing the test provided by Bernt.
History
Date User Action Args
2012-07-10 03:30:35roger.serwysetnosy: + terry.reedy
resolution: fixed
messages: + msg165151
2011-12-22 08:44:17Bernt.Røskar.Brennasetfiles: + test_idlelib.py

messages: + msg150079
2011-12-21 21:50:05roger.serwysetnosy: + roger.serwy

messages: + msg150047
versions: + Python 3.3
2010-02-08 15:47:25brian.curtinsetpriority: normal

nosy: + brian.curtin
messages: + msg99048

stage: test needed
2010-02-08 12:11:42Bernt.Røskar.Brennacreate