Issue 1027566: Argument missing from calltip for new-style class init (original) (raw)
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.