Repository navigation
Description
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,1and possible localization specific "true strings" are converted to BooleanTrue, the empty string, stringsFALSE,NO,OFFand0and possibly localization specific "false strings" are converted to BooleanFalse, and the stringNONEis converted to the PythonNoneobject. 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 toTrue),off(converted toFalse),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:
- 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.
- 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.
- 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
pekkaklarck commentedon Nov 28, 2025
Implemented by @yanne in 4d7d8e4.