Skip to content

Libdoc: Don't show return type documentation with standard types #5565

Closed

Description

@pekkaklarck

Libdoc shows documentation for recognized types used as arguments and, since RF 7.0 (#3017), also as return types. There are four kind of recognized types:

  • Standard types (str, list, Path, ...)
  • Enums
  • TypedDicts
  • Custom types

With standard types the shown documentation is part of Libdoc implementation and with all the others documentation is written by library developers. Standard type docs have been written with an idea to help users to be able to use correct values as arguments. For example, this is the documentation for the bool type:

Strings TRUE, YES, ON, 1 and possible localization specific "true strings" are converted to Boolean True, the empty string, strings FALSE, NO, OFF and 0 and possibly localization specific "false strings" are converted to Boolean False, and the string NONE is converted to the Python None object. Other strings and all other values are passed as-is, allowing keywords to handle them specially if needed. All string comparisons are case-insensitive.

Examples: TRUE (converted to True), off (converted to False), example (used as-is)

As the example above illustrates, standard type docs work well with arguments, but not at all with return types. There are three ways we could make the situation better:

  1. Update all standard library docs so that they also talk about the usage as a return value. This would require no code changes, but I'm afraid the resulting docs wouldn't work well either with arguments or with return types.
  2. Add separate argument type and return type documentation. This would be the best solution, but it requires some design and implementation work and there's no time for it in RF 7.4. I'll submit an issue about this and assign it to RF 7.5 scope.
  3. Don't show documentation with standard types used as return types in Libdoc HTML UI. This is pretty simple UI change and can still be done in RF 7.4. The change obviously needs to be reverted once it is possible to have separate return value types.

This change should only be done with standard types, because with others the user written documentation may very well work as a return type documentation. For example, the XML library just got typing (#5541) and many of its keyword are typed to return a custom Element type that has custom type documentation.

Activity

  1. added this to the v7.4 milestone on Nov 28, 2025
  2. pekkaklarck commented on Nov 28, 2025

    @pekkaklarck
    MemberAuthor

    Implemented by @yanne in 4d7d8e4.

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

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions