Is your feature request related to a problem? Please describe.
Would be nice to have a way to tell SimpleParsing to simply ignore a field, (i.e., to not try to parse it via command-line.)
Describe the solution you'd like
Something simple, elegant, and easy to implement.
Describe alternatives you've considered
Adding a ignore=True/cmd=False kwarg to field()
(bad idea) detecting some flag/specific strings in the field 'docstring'
Additional context
This would be very helpful when trying to save/load state to files, for example. Your dataclass might have some command-line arguments as well as some attributes that are used to keep some kind of state.
If field(init=False) is used, then the dataclasses.asdict(...) function doesn't return those fields, and they can't be passed to the constructor when creating them from a dictionary (read from a JSON file, for example)
Is your feature request related to a problem? Please describe. Would be nice to have a way to tell SimpleParsing to simply ignore a field, (i.e., to not try to parse it via command-line.)
Describe the solution you'd like Something simple, elegant, and easy to implement.
Describe alternatives you've considered
ignore=True
/cmd=False
kwarg tofield()
Additional context This would be very helpful when trying to save/load state to files, for example. Your dataclass might have some command-line arguments as well as some attributes that are used to keep some kind of state. If
field(init=False)
is used, then thedataclasses.asdict(...)
function doesn't return those fields, and they can't be passed to the constructor when creating them from a dictionary (read from a JSON file, for example)