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.

Author terry.reedy
Recipients serhiy.storchaka, terry.reedy
Date 2014-01-21.22:41:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1390344102.42.0.241411598779.issue20338@psf.upfronthosting.co.za>
In-reply-to
Content
Idle calltips are currently limited to 75 (signature) or 70 (doc line) chars. This is insufficient for some stdlib signatures. Example:

>>> from http.client import HTTPConnection
>>> import inspect
>>> fob=HTTPConnection.__init__
>>> line=inspect.formatargspec(*inspect.getfullargspec(fob))
>>> line, len(line)
('(self, host, port=None, strict=<object object at 0x03125148>, timeout=<object object at 0x01FF7408>, source_address=None)', 121)

The truncated tip displayed is "(self, host, port=None, strict=<object object at 0x03125148>, timeout=<object obj ..."

Given that Idle is a graphics application, not a 80-char text console application, there is no obvious reason for the particular restriction other that esthetics. The tip is in a popup window that is separate from the shell or editor window where '(' was typed. On my widescreen monitor, there is room for, say, 200 chars. If I move the underlying window to the far right, so there is not enough room for even the truncated "HTTPConnection(" tip, Windows just truncates it further, as with any other window.

Serhiy, if you have a *nix machine, can you verify that there is no problem with that either?

The limits appear in multiple places in CallTipWindow.showtip and CallTips.get_argspec. Since get_argspec truncates a docstring line to less that showtip allows, there is no ' ...' added and showtip only affects inspect signatures. Get_argspec could leave length enforcement, whatever we decide it should be, to showtip.

I think the first thing to do is replace the multiple hard-coded numbers with one named constant.
History
Date User Action Args
2014-01-21 22:41:42terry.reedysetrecipients: + terry.reedy, serhiy.storchaka
2014-01-21 22:41:42terry.reedysetmessageid: <1390344102.42.0.241411598779.issue20338@psf.upfronthosting.co.za>
2014-01-21 22:41:42terry.reedylinkissue20338 messages
2014-01-21 22:41:41terry.reedycreate