parse_args ([ '--no-foo' ]) Namespace(foo=False) The recommended way to create a custom action is to extend Action, overriding the __call__ method and optionally the __init__ and format_usage methods.
parse_args ([ 'XX', '--foo', 'YY' ]) Namespace(bar='XX', foo='YY') >>> parser.