[docs] [issue37717] argparse subcommand docs has non-existent parameter "action"

retnikt report at bugs.python.org
Tue Jul 30 03:44:41 EDT 2019

New submission from retnikt <retnikt at gmail.com>:

In the library documentation for argparse, the section for ArgumentParser.add_subparsers ( https://docs.python.org/3/library/argparse.html#sub-commands ) states that there is a parameter for 'action' with the description 'the basic type of action to be taken when this argument is encountered at the command line'. However, no such parameter actually exists, and passing it to the function causes very strange behaviour:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.6/argparse.py", line 1716, in add_subparsers
    action = parsers_class(option_strings=[], **kwargs)
TypeError: __init__() got an unexpected keyword argument 'parser_class'

This line should be removed from the documentation. It is present in versions 3.4+ and 2.7

assignee: docs at python
components: Documentation
messages: 348718
nosy: docs at python, retnikt
priority: normal
severity: normal
status: open
title: argparse subcommand docs has non-existent parameter "action"
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

Python tracker <report at bugs.python.org>

More information about the docs mailing list