-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve the "less" prompt in pydoc #120541
Comments
serhiy-storchaka
added
3.13
bugs and security fixes
3.14
new features, bugs and security fixes
labels
Jun 15, 2024
serhiy-storchaka
added a commit
to serhiy-storchaka/cpython
that referenced
this issue
Jun 15, 2024
When help() is called with non-string argument, use __qualname__ or __name__ if available, otherwise use "{typename} object".
serhiy-storchaka
added a commit
that referenced
this issue
Jun 15, 2024
When help() is called with non-string argument, use __qualname__ or __name__ if available, otherwise use "{typename} object".
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jun 15, 2024
When help() is called with non-string argument, use __qualname__ or __name__ if available, otherwise use "{typename} object". (cherry picked from commit 31d1d72) Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka
added a commit
that referenced
this issue
Jun 15, 2024
…120562) When help() is called with non-string argument, use __qualname__ or __name__ if available, otherwise use "{typename} object". (cherry picked from commit 31d1d72) Co-authored-by: Serhiy Storchaka <[email protected]>
mrahtz
pushed a commit
to mrahtz/cpython
that referenced
this issue
Jun 30, 2024
When help() is called with non-string argument, use __qualname__ or __name__ if available, otherwise use "{typename} object".
noahbkim
pushed a commit
to hudson-trading/cpython
that referenced
this issue
Jul 11, 2024
When help() is called with non-string argument, use __qualname__ or __name__ if available, otherwise use "{typename} object".
estyxx
pushed a commit
to estyxx/cpython
that referenced
this issue
Jul 17, 2024
When help() is called with non-string argument, use __qualname__ or __name__ if available, otherwise use "{typename} object".
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In #65824 the "Help on ..." was added in the "less" prompt in pydoc. It works good in the CLI or hen you call
help()
with a string, but unfortunately, it is not so good forhelp()
used in the REPL with non-string argument. For example,help(str)
has a prompt starting with "Help on type ", andhelp(str.upper)
-- "Help on method_descriptor ". In the latter case, the help text itself is started with "Help on method_descriptor:", but this is a different issue.The proposed PR improves the prompt. It now uses the objects
__qualname__
or__name__
if they are available (this covers classes, functions, methods, and many others), and falls back to "{typename} object" otherwise.Linked PRs
The text was updated successfully, but these errors were encountered: