[issue43046] argparse: capturing actions

Glenn Linderman report at bugs.python.org
Thu Jan 28 00:18:25 EST 2021


Glenn Linderman <v+python at g.nevcal.com> added the comment:

So the missing signature is why I didn't understand, probably. At least, it seems reasonable to blame that :)  You didn't include [version] in the signature, but that isn't your fault: it isn't in the original and should be (see action "version").

So key is optional and defaults to dest... I saw that, but was already confused.  This latest example clears up why you might want to overrride dest for use in different arguments... very similar to why dest is allowed to be specified instead of its default value.

And dest could be used, it is sufficient, but allowing specification of key to override it is more flexible, and could save user code in some circumstances, with little cost to the implementation.

Sounds good to me now.

I was also surprised by introduction of a "capture" action by itself, and look forward to documentation for it, as things progress. I can guess about store_capture and append_capture from the definition of extend_capture.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43046>
_______________________________________


More information about the Python-bugs-list mailing list