New submission from retnikt <retn...@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@python
components: Documentation
messages: 348718
nosy: docs@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue37717>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to