Skip to main content

Action

Standard library class argparse.Action View source
class Action
class Action
Fields 15
option_strings List[str]
dest str
nargs str
const ArgumentValue
default ArgumentValue
type Callable[([str], ArgumentValue)]
type_name str
choices _Choices
has_choices bool
required bool
help Optional[str]
metavar List[str]
deprecated bool
kind int
version Optional[str]
Constructors 1
__init__
__init__(self: Self, option_strings, dest: str, nargs = None, const = None, default = None, choices = None, required: bool = False, help: Optional[str] = None, metavar = None, deprecated: bool = False, **kwargs)
Defined in argparse
Methods 1
format_usage
format_usage(self: Self) -> str
Defined in argparse
Special methods 3
__eq__
__eq__(self: Self, other: Action, /) -> bool
Defined in argparse
__ne__
__ne__(self: Self, other: Action, /) -> bool
Defined in argparse
__call__
__call__(self: Self, parser, namespace: Namespace, values: ArgumentValue, option_string: Optional[str] = None)
Added by argparse