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.

classification
Title: Argument missing from calltip for new-style class init
Type: Stage:
Components: IDLE Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: kbk Nosy List: kbk, lguthrie
Priority: normal Keywords:

Created on 2004-09-13 22:17 by lguthrie, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg22439 - (view) Author: Loren Guthrie (lguthrie) Date: 2004-09-13 22:17
The calltip for __init__ on new-style classes doesn't
show the arguments like it does for old-style classes.

>>> import idlelib.CallTips
>>> class OldClass:
... 	"""Old-style class"""
... 	def __init__(self, x):
... 		self.x = x
... 
>>> idlelib.CallTips.get_arg_text(OldClass)
'(x)\nOld-style class'
>>> class NewClass(object):
... 	"""New-style class"""
... 	def __init__(self, x):
... 		self.x = x
... 
>>> idlelib.CallTips.get_arg_text(NewClass)
'New-style class'

Changing CallTips.py line 134 (in get_arg_text) from
if type(ob)==types.ClassType:
to
if type(ob) in [types.ClassType, types.TypeType]:

SEEMS to fix the problem, but I have no idea what
side-effects this might have.
msg22440 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2006-07-23 04:20
Logged In: YES 
user_id=149084

Rev 50776.  Thanks for the patch!
History
Date User Action Args
2022-04-11 14:56:07adminsetgithub: 40907
2004-09-13 22:17:22lguthriecreate