[issue44383] argparse.BooleanOptionalAction interacts poorly with ArgumentDefaultsHelpFormatter

2021-07-08 Thread Julian Gilbey


Change by Julian Gilbey :


--
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44383] argparse.BooleanOptionalAction interacts poorly with ArgumentDefaultsHelpFormatter

2021-07-08 Thread Julian Gilbey


Julian Gilbey  added the comment:

Yes, this is a duplicate. Marking this report as a duplicate. It's a shame that 
the other one has a conflict and has been sitting waiting for an update for 
over a year :-(
I'd be happy to help if it is of use.

--
resolution:  -> duplicate

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44383] argparse.BooleanOptionalAction interacts poorly with ArgumentDefaultsHelpFormatter

2021-07-08 Thread Toshio Kuratomi


Toshio Kuratomi  added the comment:

I believe this is a duplicate of https://bugs.python.org/issue38956 and could 
be closed in favor of that issue.

38956 also has a Pull Request to fix the issue which is awaiting a re-review.

--
nosy: +a.badger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44383] argparse.BooleanOptionalAction interacts poorly with ArgumentDefaultsHelpFormatter

2021-06-10 Thread Julian Gilbey


New submission from Julian Gilbey :

With code like the following:



import argparse

parser = argparse.ArgumentParser(
description="Test program",
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument(
"--foo",
help="Use the foo component.",
action=argparse.BooleanOptionalAction,
default=True,
)

args = parser.parse_args()



a call "python prog.py --help" then gives:


usage: prog.py [-h] [--foo | --no-foo]

Test program

optional arguments:
  -h, --help   show this help message and exit
  --foo, --no-foo  Use the foo component. (default: True) (default: True)


Note the repeated "(default: True)", one produced by the BooleanOptionalAction 
class and the other by the ArgumentDefaultsHelpFormatter.  It would be good if 
they didn't both add this helpful information.

My suggestion would be that BooleanOptionalAction should not include this 
information; it is unique in doing so.

--
components: Library (Lib)
messages: 395559
nosy: juliangilbey
priority: normal
severity: normal
status: open
title: argparse.BooleanOptionalAction interacts poorly with 
ArgumentDefaultsHelpFormatter
type: behavior
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com