bpo-37880: for argparse add_argument with action='store_const', const now defaults to None. (GH-26707)

This commit is contained in:
Jack DeVries 2021-07-31 12:27:55 -04:00 committed by GitHub
parent 1cf8424a62
commit 0ad173249d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 13 deletions

View file

@ -855,6 +855,7 @@ class Action(_AttributeHolder):
def __call__(self, parser, namespace, values, option_string=None):
raise NotImplementedError(_('.__call__() not defined'))
class BooleanOptionalAction(Action):
def __init__(self,
option_strings,
@ -936,7 +937,7 @@ class _StoreConstAction(Action):
def __init__(self,
option_strings,
dest,
const,
const=None,
default=None,
required=False,
help=None,
@ -1031,7 +1032,7 @@ class _AppendConstAction(Action):
def __init__(self,
option_strings,
dest,
const,
const=None,
default=None,
required=False,
help=None,