[ python-Bugs-1027566 ] Argument missing from calltip for new-style class init

SourceForge.net noreply at sourceforge.net
Fri Sep 17 06:47:46 CEST 2004


Bugs item #1027566, was opened at 2004-09-13 17:17
Message generated for change (Settings changed) made by kbk
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1027566&group_id=5470

Category: IDLE
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Loren Guthrie (lguthrie)
>Assigned to: Kurt B. Kaiser (kbk)
Summary: Argument missing from calltip for new-style class init

Initial Comment:
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.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1027566&group_id=5470


More information about the Python-bugs-list mailing list