This PR makes possible to specify complex return value formatters in a docstring Returns stanza.
For testing this feature I have also added a formatter method format_one_line() for map type class.
Return value type would be taken from type annotations, value formatter - from a docstring.
Dict[t, t] is internally mapped to our map class that has format_one_line formatter.
Formatter notation from a docstring would be parsed to base formatter one_line and sub-formatters short_name and hex that would be applied on dict keys and values accordingly.
Also added a test case to make sure this feature works.
This PR makes possible to specify complex return value formatters in a docstring
Returns
stanza. For testing this feature I have also added a formatter methodformat_one_line()
formap
type class.Example:
Return value type would be taken from type annotations, value formatter - from a docstring.
Dict[t, t]
is internally mapped to ourmap
class that hasformat_one_line
formatter.Formatter notation from a docstring would be parsed to base formatter
one_line
and sub-formattersshort_name
andhex
that would be applied on dict keys and values accordingly.Also added a test case to make sure this feature works.
Closes #61