Skip to content

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

Closed
@rhettinger

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.10only security fixes3.11only security fixes3.9only security fixeseasystdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions