Message385732
This sounds very good to me. Might also want action='store_capture' for a single positional definition?
capture could be a string, or any iterable of strings (tuple comes to mind)
capture_once have similar value as capture, but I wonder if the naming would be better as capture_reset to indicate the value is reset to default, rather than just captured.
Tadek said:
There could be new predefined action, e.g. 'extend_with_capture' (or just 'extend_capture') which could be used like this:
parser.add_argument('fruits', nargs='*', action='extend_capture', capture_once=['color'])
Where 'capture' would be one of: a list of parameters to capture (could be a string instead of a list if it's just one parameter) or '*' to capture all optional parameters and 'capture_once' would be similar list of parameters to capture and reset to default. |
|
Date |
User |
Action |
Args |
2021-01-26 19:56:14 | v+python | set | recipients:
+ v+python, r.david.murray, paul.j3, monkeyman79 |
2021-01-26 19:56:14 | v+python | set | messageid: <1611690974.66.0.286979817742.issue42973@roundup.psfhosted.org> |
2021-01-26 19:56:14 | v+python | link | issue42973 messages |
2021-01-26 19:56:14 | v+python | create | |
|