This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2010年02月08日 12:11 by Bernt.Røskar.Brenna, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| test_idlelib.py | Bernt.Røskar.Brenna, 2011年12月22日 08:44 | |||
| Messages (8) | |||
|---|---|---|---|
| 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. |
|||
| msg190383 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2013年05月30日 21:29 | |
#12520 deleted _find_constructor in 3.x as it works with, but only with old-style classes (gone in 3.x) and just uses getattr(ob, '__init__', None). I believe the tests in this patch duplicate existing tests at the bottom of CallTips.py (increased from 10 to 30 as part of #12510). I will recheck when I move the existing tests into the new idle_test/test_calltips.py. |
|||
| msg207821 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2014年01月10日 02:16 | |
The 3.x changes will not affect 2.7, which currently still uses _find_constructor. I suspect the .__func__ is needed for old-style classes, but I will try to check. |
|||
| msg208705 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2014年01月21日 21:01 | |
THanks for reporting this. #12520 tripled the number of tests in CallTips.py and #20122 moved them to test_calltips.py. I think they cover this case and the tests proposed. #16630 added a few more tests and patched CallTips.py to make them pass. If you find any other cases that fail with the current bugfix releases, report them on a new issue. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:57 | admin | set | github: 52131 |
| 2014年01月21日 21:01:46 | terry.reedy | set | status: open -> closed messages: + msg208705 assignee: terry.reedy resolution: fixed -> out of date stage: test needed -> resolved |
| 2014年01月10日 02:16:18 | terry.reedy | set | messages:
+ msg207821 versions: + Python 3.4, - Python 3.2 |
| 2014年01月04日 16:29:51 | serhiy.storchaka | set | dependencies: + Move CallTips tests to idle_tests |
| 2013年05月30日 21:32:56 | brian.curtin | set | nosy:
- brian.curtin |
| 2013年05月30日 21:29:55 | terry.reedy | set | messages:
+ msg190383 versions: + Python 2.7, - Python 3.1 |
| 2012年07月10日 03:30:35 | roger.serwy | set | nosy:
+ terry.reedy resolution: fixed messages: + msg165151 |
| 2011年12月22日 08:44:17 | Bernt.Røskar.Brenna | set | files:
+ test_idlelib.py messages: + msg150079 |
| 2011年12月21日 21:50:05 | roger.serwy | set | nosy:
+ roger.serwy messages: + msg150047 versions: + Python 3.3 |
| 2010年02月08日 15:47:25 | brian.curtin | set | priority: normal nosy: + brian.curtin messages: + msg99048 stage: test needed |
| 2010年02月08日 12:11:42 | Bernt.Røskar.Brenna | create | |