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

A

arserlom

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top