This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Display CallTips for classes using metaclasses.
Type: Stage:
Components: IDLE Versions:
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: kbk Nosy List: kbk, noamr
Priority: normal Keywords:

Created on 2007-08-16 12:28 by noamr, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg32646 - (view) Author: Noam Raphael (noamr) * Date: 2007-08-16 12:28
Hello,

Currently, if you write something like this:

class MyType(type):
    pass

class MyClass(object):
    __metaclass__ = MyType
    def __init__(self, a):
        pass

And write in the shell:

>>> MyClass(

a calltip won't be displayed.

To fix this, replace this line in CallTups.py:

if type(ob) in (types.ClassType, types.TypeType):

with this one:

if issubclass(type(ob), (types.ClassType, types.TypeType)):

and now it works.

Thanks,
Noam
msg56298 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2007-10-09 23:44
Appears this was fixed at r55818, though with a typo. Module
heavily rewritten since then to use the inspect module.  The
example below now works without further changes.
History
Date User Action Args
2022-04-11 14:56:26adminsetgithub: 45318
2007-10-09 23:44:07kbksetstatus: open -> closed
resolution: out of date
messages: + msg56298
2007-08-16 12:28:59noamrcreate