Author eht16
Recipients eht16
Date 2019-08-04.12:48:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1564922900.31.0.640915952302.issue37755@roundup.psfhosted.org>
In-reply-to
Content
I noticed a probably unintended behavior in help() usage:

when an output is set on pydoc.Helper(), most of its methods
use this output instead of a pager.
But 'True', 'False' and 'None' as well as all topics, keywords
and symbols always use a pager instead of the configured output.

My use case is to use the pydoc help system to display help contents
in Geany (a text editor) in a graphical manner
(and so I cannot make any use of a pager).

Example code:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from io import StringIO
import pydoc
import sys


if __name__ == '__main__':
    help_text = StringIO()

    helper = pydoc.Helper(output=help_text)
    # help contents are written to help_text as expected
    helper.help('pydoc')

    # the following calls each show the help contents in a pager instead
    # of using the configured output
    helper.help('True')
    helper.help('False')
    helper.help('None')
    helper.help('**')  # symbol example
    helper.help('SEQUENCES')  # topic example
    helper.help('await')  # keyword example


Tested against Python 3.7.3.
History
Date User Action Args
2019-08-04 12:48:20eht16setrecipients: + eht16
2019-08-04 12:48:20eht16setmessageid: <1564922900.31.0.640915952302.issue37755@roundup.psfhosted.org>
2019-08-04 12:48:20eht16linkissue37755 messages
2019-08-04 12:48:19eht16create