Skip to content

Add parentheses to license in repl splash text #104471

Closed as not planned
Closed as not planned

Description

@reuven

For as long as I can remember, starting the interactive Python shell shows something like this:

Python 3.11.3 (main, Apr  7 2023, 19:25:52) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

This seems super helpful, right? The only issue is that while "copyright" and "credits" are both strings, "help" and "license" are both functions.

If you want help, you need to call help() or help(thing). And if you want to see the license, you need to call it, as in license().

The current text is thus misleading, omitting the parentheses. But we know this, because if I try to invoke them without parentheses, I get the following:

>>> help
Type help() for interactive help, or help(object) for help about object.
>>> license
Type license() to see the full license text

In other words: We tell people to type "help". Then they do that, and we say, "Actually, you need to type help()." Ditto with license.

I think that the help text should more accurately describe what people should type to get help or see the license. As things now stand, we seem to know that people will mistakenly type the words without parentheses, but instead of telling them the right thing, we're redirecting them when they try it.

Linked PRs

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    on May 14, 2023
  2. eryksun commented on May 14, 2023

    @eryksun
    Contributor

    Note that copyright and credits are not strings. If they were, their repr wouldn't display as formatted output as it does.

    >>> type(credits)
    <class '_sitebuiltins._Printer'>
    >>> type(copyright)
    <class '_sitebuiltins._Printer'>

    license is also a _Printer, but it has to be called because its line count exceeds MAXLINES (23).

    >>> type(license)
    <class '_sitebuiltins._Printer'>
    >>> type(license).MAXLINES
    23
    >>> license._Printer__linecnt
    280
  3. pochmann commented on May 14, 2023

    @pochmann
    Contributor

    You PR changes it to:

    Type "help()", "copyright", "credits" or "license()" for more information.

    But typing "help()" enters the interactive help. What if people don't want to do that? How will they now learn about the "help(object)" alternative?

  4. leuneri commented on May 14, 2023

    @leuneri

    But typing "help()" enters the interactive help. What if people don't want to do that? How will they now learn about the "help(object)" alternative?

    A consideration could be to add the "help(object)" alternative into the description when entering interactive help

  5. eamanu commented on May 14, 2023

    @eamanu
    Contributor

    If the banner says type "help(object)" and I'm a beginner probably, I'll type help(object) and I will be more confused, trying to understand what is the object class.

    IMO, the current string is ok, at least for the help method. Because if you type help you more information is printed:

    Type help() for interactive help, or help(object) for help about object.
    

    So, ok typing help I learned that is an interactive help, and I can send an object to get help about object (perhaps that message can be improve)

    In the case of license, I agree that would be better have the license() in the banner.

  6. reuven commented on May 14, 2023

    @reuven
    Author

    Good points, all! (And I'm sure that more are coming...)

    I didn't have a specific suggestion for what the text should say, just that we shouldn't say "type x" and then when they type x, they're told, "Actually, type x()". That strikes me as confusing.

    I agree that pointing to both help() and help(object) is a good idea, although the fact that object is a real thing, and not a placeholder, strikes me as another confusing thing to write. After all, almost no one really wants help on object. I'm not sure how to make it both short and clear. Maybe help(THING), but someone out there will file a PR that THING doesn't exist.

    Maybe moving the text that you get from typing help into that line would be useful?

    I'm not sure what the right answer is here. I'm just pretty sure that the current text is misleading. You could argue that so few people use it, that it doesn't make a difference, but I'm not super satisfied with that, either.

  7. eamanu commented on May 17, 2023

    @eamanu
    Contributor

    I'm not sure what the right answer is here. I'm just pretty sure that the current text is misleading. You could argue that so few people use it, that it doesn't make a difference, but I'm not super satisfied with that, either.

    Yes, I think this is a difficult change, with lot of possibility.

    From my point of view, typing help give us information about itself. I'd add an example in that help's help() text about how to use. And yes I 'd change license by license() in the welcome prompt

  8. matthew-fogel commented on May 27, 2023

    @matthew-fogel

    I agree this is a difficult change

    @reuven Interestingly, the docstring for function _Helper does say Calling help(thing) prints help for the python object 'thing'. which is similar to your suggestion.

    The __repr__ for that same function says help(object) for help about object. I agree with you and @eamanu that beginner users may not realize object is a placeholder and type help(object) instead of help(PLACEHOLDER).

    Maybe changing the __repr__ to more closely match the docstring would improve clarity?

    @leuneri You may be interested in #94466, a related issue. The current description when entering interactive help is misleading and can cause confusion.

    If the plan is to change help's help() text to address this issue I think that #94466 could be addressed at the same time

  9. eamanu commented on May 27, 2023

    @eamanu
    Contributor

    @reuven Interestingly, the docstring for function _Helper does say Calling help(thing) prints help for the python object 'thing'. which is similar to your suggestion.

    I did not note it, and IMO is a good option.

  10. added
    stdlibStandard Library Python modules in the Lib/ directory
    and removed
    interpreter-core(Objects, Python, Grammar, and Parser dirs)
    on May 28, 2023
  11. terryjreedy commented on Jun 27, 2023

    @terryjreedy
    Member

    I suggest that we simplify the splash line to one suggestion, as unambiguous as possible.

    Enter "help" (without quotes) at a >>> prompt for help options.

    Then explain the options better. Put the most frequently used option first and properly explain it.

    "help(obj)" displays information about a class, which will be obj itself, the one named, or the class of obj.
    For example, "help(int)", help('int'), and "help(0)" all display information about class int.
    "help()" enters an interactive help mode with its own instructions; enter "quit" to quit that mode.
    "credit", "copyright", and "license()" each display information about the respective subject.

    @iritkatriel Coredev comments needed and wanted.

  12. iritkatriel commented on Jun 28, 2023

    @iritkatriel
    Member

    @terryjreedy sound reasonable, but I think if we change where the license and copyright are mentioned we should run this by the lawyers first.

  13. cfbolz commented on Jul 30, 2024

    @cfbolz
    Contributor

    This issue is half-way fixed in py 3.13 with pyrepl. There, typing help without parenthesis will open the new help browser.

  14. changed the title [-]Help text in interactive Python is misleading[/-] [+]Add parentheses to `license` in repl splash text[/+] on Aug 17, 2025
  15. added
    type-featureA feature request or enhancement
    and removed
    type-bugAn unexpected behavior, bug, or error
    on Jul 3, 2026
  16. StanFromIreland commented on Aug 26, 2026

    @StanFromIreland
    Member

    Since help was fixed, I don't think changing copyright and license matters, most people won't ever use/need them anyway. Closing as won't fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shelltype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions