Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[argparse] Add required argument to add_subparsers #70697

Closed
memeplex mannequin opened this issue Mar 8, 2016 · 12 comments
Closed

[argparse] Add required argument to add_subparsers #70697

memeplex mannequin opened this issue Mar 8, 2016 · 12 comments
Assignees
Labels
3.7 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@memeplex
Copy link
Mannequin

memeplex mannequin commented Mar 8, 2016

BPO 26510
Nosy @ned-deily, @merwok, @asottile, @miss-islington
PRs
  • bpo-26510: Allow argparse add_subparsers to take required kwarg. #3027
  • bpo-33109: argparse subparsers are once again not required by default #6919
  • [3.7] bpo-33109: argparse subparsers are once again not required by default (GH-6919) #7089
  • bpo-33109: Remove now-obsolete What's New entry for bpo-26510. #7609
  • [3.7] bpo-33109: Remove now-obsolete What's New entry for bpo-26510. (GH-7609) #7610
  • bpo-26510: Add versionchanged for required arg of add_subparsers #16588
  • [3.8] bpo-26510: Add versionchanged for required arg of add_subparsers (GH-16588) #16608
  • [3.7] bpo-26510: Add versionchanged for required arg of add_subparsers (GH-16588) #16609
  • 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 = 'https://github.com/merwok'
    closed_at = <Date 2017-09-20.21:36:42.299>
    created_at = <Date 2016-03-08.13:56:01.475>
    labels = ['3.7', 'type-feature', 'library']
    title = '[argparse] Add required argument to add_subparsers'
    updated_at = <Date 2019-10-15.07:30:26.268>
    user = 'https://bugs.python.org/memeplex'

    bugs.python.org fields:

    activity = <Date 2019-10-15.07:30:26.268>
    actor = 'ned.deily'
    assignee = 'eric.araujo'
    closed = True
    closed_date = <Date 2017-09-20.21:36:42.299>
    closer = 'eric.araujo'
    components = ['Library (Lib)']
    creation = <Date 2016-03-08.13:56:01.475>
    creator = 'memeplex'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 26510
    keywords = []
    message_count = 12.0
    messages = ['261358', '261535', '300282', '302660', '317500', '317512', '319265', '319267', '354060', '354061', '354062', '354700']
    nosy_count = 7.0
    nosy_names = ['bethard', 'ned.deily', 'eric.araujo', 'memeplex', 'paul.j3', 'Anthony Sottile', 'miss-islington']
    pr_nums = ['3027', '6919', '7089', '7609', '7610', '16588', '16608', '16609']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue26510'
    versions = ['Python 3.7']

    @memeplex
    Copy link
    Mannequin Author

    memeplex mannequin commented Mar 8, 2016

    It's useful in combination with dest. Currently you have to set required as an attribute. This is not only inconsistent but not even documented as a valid usage (in general, it's not clear from the docs whether attribute setting -vs argument passing- is a valid usage).

    @memeplex memeplex mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Mar 8, 2016
    @memeplex memeplex mannequin changed the title Add required argument to add_subparsers [argparse] Add required argument to add_subparsers Mar 8, 2016
    @paulj3
    Copy link
    Mannequin

    paulj3 mannequin commented Mar 11, 2016

    This has been raised before. I think

    http://bugs.python.org/issue9253

    is the correct issue.

    It used to be that 'subparsers' were required. But there was a change in how 'required' arguments were tested, and 'subparsers' fell through the cracks. Now subparsers are optional (at least the parser doesn't raise an error). The temporary fix is to set the 'required' attribute after creation.

    I proposed that the default be 'required=True', and that we be allowed to set the parameter. But that patch, like many others, has languished.

    @asottile
    Copy link
    Mannequin

    asottile mannequin commented Aug 15, 2017

    I've added a patch for this #3027

    Would love to get a review so it could be included

    @merwok merwok added the 3.7 (EOL) end of life label Sep 20, 2017
    @merwok merwok self-assigned this Sep 20, 2017
    @merwok
    Copy link
    Member

    merwok commented Sep 20, 2017

    New changeset aaf6fc0 by Éric Araujo (Anthony Sottile) in branch 'master':
    bpo-26510: make argparse subparsers required by default (bpo-3027)
    aaf6fc0

    @merwok merwok closed this as completed Sep 20, 2017
    @ned-deily
    Copy link
    Member

    New changeset 8ebf5ce by Ned Deily in branch 'master':
    bpo-33109: argparse subparsers are once again not required by default (GH-6919)
    8ebf5ce

    @ned-deily
    Copy link
    Member

    New changeset dd7a255 by Ned Deily (Miss Islington (bot)) in branch '3.7':
    bpo-33109: argparse subparsers are once again not required by default (GH-6919) (GH-7089)
    dd7a255

    @ned-deily
    Copy link
    Member

    New changeset ef057bf by Ned Deily in branch 'master':
    bpo-33109: Remove now-obsolete What's New entry for bpo-26510. (GH-7609)
    ef057bf

    @ned-deily
    Copy link
    Member

    New changeset a73399d by Ned Deily (Miss Islington (bot)) in branch '3.7':
    bpo-33109: Remove now-obsolete What's New entry for bpo-26510. (GH-7609) (GH-7610)
    a73399d

    @miss-islington
    Copy link
    Contributor

    New changeset 9e71917 by Miss Islington (bot) (Adam J. Stewart) in branch 'master':
    bpo-26510: Add versionchanged for required arg of add_subparsers (GH-16588)
    9e71917

    @miss-islington
    Copy link
    Contributor

    New changeset 50b8d57 by Miss Islington (bot) in branch '3.7':
    bpo-26510: Add versionchanged for required arg of add_subparsers (GH-16588)
    50b8d57

    @miss-islington
    Copy link
    Contributor

    New changeset f19b4d7 by Miss Islington (bot) in branch '3.8':
    bpo-26510: Add versionchanged for required arg of add_subparsers (GH-16588)
    f19b4d7

    @ned-deily
    Copy link
    Member

    New changeset f168c17 by Ned Deily (Miss Islington (bot)) in branch '3.7':
    bpo-26510: Add versionchanged for required arg of add_subparsers (GH-16588)
    f168c17

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants