Add `cli_converter` argument to `Config`
To allow a list as a CLI argument, one currently has to use a converter:
def cli_arg_to_list(arg):
return [float(e) for e in arg.split(",")]
@Configurable
class Foo:
l = Config("A list", factory=lambda: [1, 2], converter=cli_arg_to_list)
However, this does not just accept --Foo.l 3,4
on the command line, but also enables a constructor like Foo("3,4")
, which might not be desired.
A possible solution would be to create a new cli_converter
argument to Config
that is applied only during CLI parsing and not in the general constructor.