We already have a concept of complex types that are composed of simpler types in typedargs. Python 3 function annotations have a similar concept as well that lets you declare a return type of, for example, Dict[str, int].
As part of supporting function annotations as a valid way of declaring types to typedargs, we should map a complex type like Dict[str, int] to our internal complex type of dict(str, int) which is how we could have specified it in a docstring or legacy @param decorator.
This should work for both function parameters and return values.
We already have a concept of complex types that are composed of simpler types in
typedargs
. Python 3 function annotations have a similar concept as well that lets you declare a return type of, for example,Dict[str, int]
.As part of supporting function annotations as a valid way of declaring types to
typedargs
, we should map a complex type likeDict[str, int]
to our internal complex type ofdict(str, int)
which is how we could have specified it in a docstring or legacy@param
decorator.This should work for both function parameters and return values.