New submission from Terry J. Reedy:

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.

----------
assignee: terry.reedy
messages: 208716
nosy: serhiy.storchaka, terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: Idle: increase max calltip width
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20338>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to