Skip to content

argparse docs: Positional * argument in mutually exclusive group requires a default parameter #70423

Closed as not planned

Description

@paulj3
mannequin
BPO 26235

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2016-01-29.00:16:38.018>
labels = ['docs']
title = 'argparse docs: Positional * argument in mutually exclusive group requires a default parameter'
updated_at = <Date 2016-01-30.02:42:42.063>
user = 'https://bugs.python.org/paulj3'

bugs.python.org fields:

activity = <Date 2016-01-30.02:42:42.063>
actor = 'terry.reedy'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2016-01-29.00:16:38.018>
creator = 'paul.j3'
dependencies = []
files = []
hgrepos = []
issue_num = 26235
keywords = []
message_count = 1.0
messages = ['259179']
nosy_count = 3.0
nosy_names = ['bethard', 'docs@python', 'paul.j3']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue26235'
versions = ['Python 3.6']

Activity

  1. paulj3 commented on Jan 29, 2016

    paulj3mannequin
    MannequinAuthor

    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

  2. transferred this issue fromon Apr 10, 2022
  3. serhiy-storchaka commented on Sep 26, 2024

    @serhiy-storchaka
    Member

    It was changed in #124306.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions