[issue35641] IDLE: calltips not properly formatted for functions without doc-strings

Tal Einat report at bugs.python.org
Wed Jan 2 11:43:40 EST 2019


New submission from Tal Einat <taleinat at gmail.com>:

IDLE usually wraps call-tips to 85 characters.  However, for functions without a doc-string, this formatting is skipped.  This is an issue for functions with long signatures, e.g. due to having many arguments or due to having default values with long repr-s.

This appears to be caused by line 170 in Lib/idlelib/calltip.py being indented once too much. (see: https://github.com/python/cpython/blob/87e59ac11ee074b0dc1bc864c74fac0660b27f6e/Lib/idlelib/calltip.py)

Thanks to Dan Snider for the original report in msg332881 on issue #35196.


Example:

>>> def foo(s='a'*100):
	pass

>>> print(get_argspec(foo))
(s='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')

>>> def bar(s='a'*100):
	"""doc-string"""
	pass

>>> print(get_argspec(bar))
(s='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaa')
doc-string

----------
messages: 332882
nosy: bup, taleinat
priority: normal
severity: normal
status: open
title: IDLE: calltips not properly formatted for functions without doc-strings

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35641>
_______________________________________


More information about the Python-bugs-list mailing list