You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pydoc topics, keywords and symbols always use pager instead of output #81936
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2019-08-04.12:48:20.274>labels= ['3.8', 'type-bug', 'library']
title='pydoc topics, keywords and symbols always use pager instead of output'updated_at=<Date2019-08-04.12:55:23.691>user='https://github.com/eht16'
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 --
fromioimportStringIOimportpydocimportsysif__name__=='__main__':
help_text=StringIO()
helper=pydoc.Helper(output=help_text)
# help contents are written to help_text as expectedhelper.help('pydoc')
# the following calls each show the help contents in a pager instead# of using the configured outputhelper.help('True')
helper.help('False')
helper.help('None')
helper.help('**') # symbol examplehelper.help('SEQUENCES') # topic examplehelper.help('await') # keyword example
Activity
eht16 commentedon Aug 4, 2019
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 --
Tested against Python 3.7.3.
serhiy-storchaka commentedon Jun 8, 2024
Thank you for your contribution @eht16. Sorry it took so long to review and merge your PR.
eht16 commentedon Jun 8, 2024
It took me to answer almost as long :D.
Thank you for the review.
merwok commentedon Dec 17, 2024
Thanks for fixing this old bug!