[issue26510] [argparse] Add required argument to add_subparsers

paul j3 report at bugs.python.org
Thu Mar 10 19:01:03 EST 2016


paul j3 added the comment:

This has been raised before.  I think

http://bugs.python.org/issue9253

is the correct issue.

It used to be that 'subparsers' were required.  But there was a change in how 'required' arguments were tested, and 'subparsers' fell through the cracks.  Now subparsers are optional (at least the parser doesn't raise an error).  The temporary fix is to set the 'required' attribute after creation.

I proposed that the default be 'required=True', and that we be allowed to set the parameter.  But that patch, like many others, has languished.

----------
nosy: +paul.j3

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


More information about the Python-bugs-list mailing list