classification
Title: IDLE: Show help(object) output in a text viewer
Type: enhancement Stage: patch review
Components: IDLE Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: taleinat Nosy List: rhettinger, taleinat, terry.reedy
Priority: normal Keywords: patch

Created on 2019-08-05 20:56 by taleinat, last changed 2019-09-03 05:42 by terry.reedy.

Pull Requests
URL Status Linked Edit
PR 15140 open taleinat, 2019-08-05 21:03
Messages (5)
msg349073 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2019-08-05 20:56
Currently, IDLE just writes the entire help message into the shell.

If auto-squeezing is enabled, then long help messages are automatically squeezed, following which the help text can be viewed in a text viewer or expanded inline.  This is still not great UX.

I propose to simply have help(object) open a text viewer with the help text.  There's actually an old (2007) comment in Lib\idlelib\pyshell.py by KBK that this should be done.

See related discussion in issue #35855.
msg349075 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2019-08-05 21:04
See PR GH-15140.
msg349076 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2019-08-05 21:06
Raymond, I'm interested in your opinion on this.
msg351059 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-09-03 05:13
For myself, I only want this for 'large' outputs.  I prefer something like the following left alone.

>>> help('continue')
The "continue" statement
************************

   continue_stmt ::= "continue"

"continue" may only occur syntactically nested in a "for" or "while"
loop, but not nested in a function or class definition within that
loop.  It continues with the next cycle of the nearest enclosing loop.

When "continue" passes control out of a "try" statement with a
"finally" clause, that "finally" clause is executed before really
starting the next loop cycle.

Related help topics: while, for

The threshhold for squeezer should be good enough.  I think of this as autosqueeze + autoexpand if this if the first output after '>>>' and the statement began with 'help('.  An advantage of doing it this way is that the squeezer button remains after dismissing the viewer.

Also, I suspect that most people who disable squeezer would not like this either.
msg351065 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-09-03 05:42
I should have said, 'who disable autosqueeze'.  Anyway, an option to disable help autoview will make me more comfortable adding it.

A similar change would be to add 'Squeeze & View' to the context menu.
History
Date User Action Args
2019-09-03 05:42:42terry.reedysetmessages: + msg351065
2019-09-03 05:13:44terry.reedysetmessages: + msg351059
2019-08-05 21:06:54taleinatsetnosy: + rhettinger
messages: + msg349076
2019-08-05 21:04:26taleinatsetmessages: + msg349075
2019-08-05 21:03:51taleinatsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request14878
2019-08-05 20:56:06taleinatcreate