Open
Description
According to argparse docs on that matter,
If the type keyword is used with the default keyword, the type converter is only applied if the default is a string.
I'm trying to parse datetime, expect the input (and generated help) to be in %Y-%m
format.
class Args(tap.TypedArgs):
gen_conf: bool = tap.arg("--gen-conf",help="generate example config",default=False)
since: datetime = tap.arg(default=datetime.strftime("%Y-%m"), type=datetime.strptime) # str | datetime
couldn't type
have proprity over default
in this case? or, if type
is a -> T
and default
is a
, couldn't default
be "type-applied" against type
?
Metadata
Metadata
Assignees
Labels
No labels