Modifying CallTips.py to work with with new-style classes in IDLE.

arserlom at gmail.com arserlom at gmail.com
Sat May 14 08:02:03 EDT 2005


When using Idle, Call Tips are floating windows which display function,
class, and method parameter and docstring information when you type an
opening parenthesis, and which disappear when you type a closing
parenthesis.

But when you use new-style classes, they don't work fine and don't show
the arguments of the __init__ method.

There is a topic in this newsgroup (new style classes and an IDLE
"grump"), where a solution was given to the problem (in Mar 27 2002):

> The solution seems to be simply changing line 115 in CallTips.py (in
the
> Tools/Idle/ directory) as folows:
>
>     if type(ob)==types.ClassType:
>
>   to
>
>     if type(ob)==types.ClassType or type(ob) == types.TypeType:

I've tried it (Python 2.4.1 - IDLE 1.1.1) and it works fine (CallTips
was in the \Lib\idlelib directory for me).

Why isn't this the default behaviour? Is this the right place to post
this?




More information about the Python-list mailing list