[issue26394] Have argparse provide ability to require a fallback value be present

paul j3 report at bugs.python.org
Sun May 28 19:58:38 EDT 2017


paul j3 added the comment:

http://bugs.python.org/issue29670
argparse: does not respect required args pre-populated into namespace

wants to put 'required' values in the Namespace.  That's a similar issue.

An idea that I tried for that (but didn't submit as a patch) is to move the tests at the end of _parse_know_args to a separate function that is called by parse_known_args.  

In http://bugs.python.org/issue26394#msg261540 I suggested putting the fallback in the testing section of _parse_known_args.  If that testing section is in a separate method, it would be easier to customize and add such a fallback.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26394>
_______________________________________


More information about the Python-bugs-list mailing list