Cast functions can be trivially composed, because each takes exactly one argument and returns exactly one value. This can currently be done using a lambda function, but the syntax is verbose:
appcli.param(
...
cast=lambda x: f(g(x)),
...
)
I think it could be convenient to interpret a list of cast functions as functions to be composed. In other words, the snippet below would be equivalent to the snippet above:
Another advantage of supporting this implicit function composition syntax is that I can give better error messages: if one of the functions fails, I can say exactly which one.
Cast functions can be trivially composed, because each takes exactly one argument and returns exactly one value. This can currently be done using a lambda function, but the syntax is verbose:
I think it could be convenient to interpret a list of cast functions as functions to be composed. In other words, the snippet below would be equivalent to the snippet above: