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

Discussion in 'Python' started by arserlom@gmail.com, May 14, 2005.

  1. Guest

    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?
    , May 14, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tocer
    Replies:
    0
    Views:
    467
    tocer
    Aug 28, 2004
  2. Max Derkachev
    Replies:
    4
    Views:
    673
    Jack Diederich
    May 5, 2005
  3. ankit
    Replies:
    1
    Views:
    340
    Alex Martelli
    Dec 22, 2005
  4. Isaac Rodriguez

    Are all classes new-style classes in 2.4+?

    Isaac Rodriguez, Dec 31, 2006, in forum: Python
    Replies:
    4
    Views:
    388
    Steven D'Aprano
    Dec 31, 2006
  5. Quek
    Replies:
    3
    Views:
    335
Loading...

Share This Page