Glenn Linderman <[email protected]> added the comment:
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.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue42973>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com