This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: argparse docs: Positional * argument in mutually exclusive group requires a default parameter
Type: Stage:
Components: Documentation Versions: Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: bethard, docs@python, paul.j3
Priority: normal Keywords:

Created on 2016-01-29 00:16 by paul.j3, last changed 2022-04-11 14:58 by admin.

Messages (1)
msg259179 - (view) Author: paul j3 (paul.j3) * (Python triager) Date: 2016-01-29 00:16
The documentation for Mutual exclusion

https://docs.python.org/3/library/argparse.html#mutual-exclusion

needs a note that a mutually exclusive group may contain one positional argument.  But that argument must be either nargs='?', or nargs='*'.  If '*' it must also have a default parameter (other than None).

(this issue came up recently on stackoverflow.  It may have also been raised in the past as a bug/issue, but I don't have time at moment to search.  I had to search through several layers of code to remember all the details.)

http://stackoverflow.com/questions/35044288/how-can-i-create-an-argparse-mutually-exclusive-group-with-multiple-positional-p
History
Date User Action Args
2022-04-11 14:58:26adminsetgithub: 70423
2016-01-30 02:42:42terry.reedysetnosy: + bethard
2016-01-29 00:16:38paul.j3create