[New-bugs-announce] [issue26235] argparse docs: Positional * argument in mutually exclusive group requires a default parameter

paul j3 report at bugs.python.org
Thu Jan 28 19:16:38 EST 2016


New submission from paul j3:

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

----------
assignee: docs at python
components: Documentation
messages: 259179
nosy: docs at python, paul.j3
priority: normal
severity: normal
status: open
title: argparse docs: Positional * argument in mutually exclusive group requires a default parameter
versions: Python 3.6

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


More information about the New-bugs-announce mailing list