[issue23487] argparse: add_subparsers 'action' broken

paul j3 report at bugs.python.org
Sun Mar 22 21:01:53 CET 2015


paul j3 added the comment:

It certainly looks like a documentation issue.  `action` doesn't make sense here.  `add_subparsers` normally creates an Action of type `_SubParsersAction`.  

'action' for normal 'add_argument' command defines the Action type created at that time.  Conceivably a user might want to use a customized '_SubParsersAction', but it shouldn't be as easy as just specifying 'action' in the 'add_subparsers' command.

And specifying something other than the default 'store' action class for the arguments of the parsers doesn't make sense.

But I'm puzzled by the error message you got.  I'll have to run some tests to figure out what is going on.

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

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


More information about the Python-bugs-list mailing list