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
Libdoc: Support separate type documentation for arguments and return values #5566
Libdoc shows documentation for recognized types used as arguments and, since RF 7.0 (#3017), 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 the Libdoc implementation and with the other types the docs come from the types themselves and are written by library developers.
This system works well in general, but if the same type is used with arguments and also as a return type, writing good documentation that covers both usages can be problematic. Argument type documentation should in general specify what arguments are allowed, while the return type documentation should explain how the return value can be used, what kind of attributes custom objects have, and so on.
A solution to this problem is making it possible to have separate documentation for argument types and return types. This is what getting it done requires in high level:
Design how to store separate argument and return type docs in Libdoc spec files.
Update Libdoc HTML UI accordingly.
Write return type docs for standard types.
Design how other types can specify return type docs. Currently docs are got from class or function docstrings, and we could support some marker there that would separate different docs. Alternatively classes/functions could have a custom attribute like type_doc that could be a two-tuple with argument and return type docs separately.
The current standard type docs have been written with an idea that they are only used with arguments. They were so confusing as return type docs that RF 7.4 disabled showing them in Libdoc HTML UI (#5565). That change needs to be reverted as part of this issue when it is possible to have separate docs for return types.
changed the title [-]Libdoc: Support separate argument and return type documentations[/-][+]Libdoc: Support separate argument and return type documentation[/+]on Nov 29, 2025
changed the title [-]Libdoc: Support separate argument and return type documentation[/-][+]Libdoc: Support separate type documentation for arguments and return values[/+]on Mar 23, 2026
Activity
pekkaklarck commentedon Nov 28, 2025
The current standard type docs have been written with an idea that they are only used with arguments. They were so confusing as return type docs that RF 7.4 disabled showing them in Libdoc HTML UI (#5565). That change needs to be reverted as part of this issue when it is possible to have separate docs for return types.
[-]Libdoc: Support separate argument and return type documentations[/-][+]Libdoc: Support separate argument and return type documentation[/+][-]Libdoc: Support separate argument and return type documentation[/-][+]Libdoc: Support separate type documentation for arguments and return values[/+]