Skip to content

The argparse Action class omits "required" for the "names" list #91832

Closed

Description

@rhettinger

This has the user visible effect of the required attribute not displaying in the repr:

>>> a = ArgumentParser().add_argument('-a', required=True)
>>> a.required
True
>>> a
_StoreAction(option_strings=['-a'], dest='a', nargs=None, const=None, default=None, type=None, choices=None, help=None, metavar=None)

Activity

  1. added
    type-bug
    on Apr 22, 2022
  2. added
    stdlib
    on Apr 22, 2022
  3. fatihkabakk commented on Apr 22, 2022

    @fatihkabakk
    Contributor

    Found the solution, working on the commit.

  4. added
    3.11
    3.10 (EOL)
    3.9 (EOL)
    on Apr 28, 2022
  5. added 4 commits that reference this issue on Apr 28, 2022
  6. merwok commented on Apr 28, 2022

    @merwok
    Member

    Fixed, thanks to you both for the pull requests!

  7. added a commit that references this issue on Jun 2, 2022
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

    3.10 (EOL)3.113.9 (EOL)easystdlibtype-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions