[issue41980] Argparse documentation is slightly misleading

Yannick Gingras report at bugs.python.org
Sat Oct 10 09:07:37 EDT 2020


Yannick Gingras <ygingras at ygingras.net> added the comment:

Raymond, I would love to submit the PR if we reach a consensus on what the new message should be.  I'm a bit out of touch with how things work these days.  Is Github the best place to submit the PR?

Paul, very good digging!  Reading the coding and running a few examples, I understand that the ``prog`` of the subparser is always the name of the main program with the name of the subcommand *unless* a usage string is supplied, in which case it overrides prog.  I suspect that the intent is to favour the programmer supplied usage string and that copying the usage string in the prog of the subparser is an implementation detail.   I think we can reword the documentation to describe the expected behavior with more emphasis on the common cases.

----------

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


More information about the Python-bugs-list mailing list