mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-37880: for argparse add_argument with action='store_const', const now defaults to None. (GH-26707)
This commit is contained in:
parent
1cf8424a62
commit
0ad173249d
4 changed files with 41 additions and 13 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue