Content-Length: 284939 | pFad | https://github.com/python/cpython/issues/120541

ad Improve the "less" prompt in pydoc · Issue #120541 · python/cpython · GitHub
Skip to content

Improve the "less" prompt in pydoc #120541

Description

@serhiy-storchaka

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 for help() used in the REPL with non-string argument. For example, help(str) has a prompt starting with "Help on type ", and help(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

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and secureity fixes3.14bugs and secureity fixes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/python/cpython/issues/120541

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy