Commit 20490d5
pythongh-88753: Make BooleanOptionalAction's addition of default to help more similar to other actions (python#27808)
Help for other actions omit the default value if default is SUPPRESS or
already contains the special format string '%(default)'. Add those
special cases to BooleanOptionalAction's help formatting too.
Fixes https://bugs.python.org/issue44587 so that default=SUPPRESS is not
emitted.
Fixes https://bugs.python.org/issue38956 as this code will detect
whether '%(default)s' has already been specified in the help string.
Signed-off-by: Micky Yun Chan (michiboo): <[email protected]>
Co-authored-by: Micky Yun Chan <[email protected]>1 parent 6c25bf0 commit 20490d5
File tree
3 files changed
+32
-16
lines changed- Lib
- test
- Misc/NEWS.d/next/Library
3 files changed
+32
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
| |||
695 | 696 | | |
696 | 697 | | |
697 | 698 | | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
698 | 707 | | |
699 | | - | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
700 | 712 | | |
701 | 713 | | |
702 | 714 | | |
703 | 715 | | |
704 | 716 | | |
705 | 717 | | |
706 | 718 | | |
| 719 | + | |
707 | 720 | | |
708 | 721 | | |
709 | 722 | | |
| |||
719 | 732 | | |
720 | 733 | | |
721 | 734 | | |
722 | | - | |
723 | 735 | | |
724 | 736 | | |
725 | 737 | | |
| |||
882 | 894 | | |
883 | 895 | | |
884 | 896 | | |
885 | | - | |
886 | | - | |
887 | | - | |
888 | 897 | | |
889 | 898 | | |
890 | 899 | | |
| |||
896 | 905 | | |
897 | 906 | | |
898 | 907 | | |
| 908 | + | |
899 | 909 | | |
900 | 910 | | |
901 | 911 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3348 | 3348 | | |
3349 | 3349 | | |
3350 | 3350 | | |
| 3351 | + | |
3351 | 3352 | | |
3352 | 3353 | | |
3353 | 3354 | | |
| |||
3743 | 3744 | | |
3744 | 3745 | | |
3745 | 3746 | | |
3746 | | - | |
| 3747 | + | |
3747 | 3748 | | |
3748 | 3749 | | |
3749 | 3750 | | |
| |||
4423 | 4424 | | |
4424 | 4425 | | |
4425 | 4426 | | |
| 4427 | + | |
| 4428 | + | |
4426 | 4429 | | |
4427 | 4430 | | |
4428 | 4431 | | |
| |||
4432 | 4435 | | |
4433 | 4436 | | |
4434 | 4437 | | |
4435 | | - | |
4436 | | - | |
| 4438 | + | |
| 4439 | + | |
4437 | 4440 | | |
4438 | 4441 | | |
4439 | 4442 | | |
4440 | 4443 | | |
4441 | 4444 | | |
4442 | 4445 | | |
4443 | 4446 | | |
4444 | | - | |
4445 | | - | |
| 4447 | + | |
| 4448 | + | |
4446 | 4449 | | |
4447 | 4450 | | |
4448 | | - | |
4449 | | - | |
4450 | | - | |
4451 | | - | |
4452 | | - | |
| 4451 | + | |
| 4452 | + | |
| 4453 | + | |
| 4454 | + | |
| 4455 | + | |
| 4456 | + | |
4453 | 4457 | | |
4454 | 4458 | | |
4455 | 4459 | | |
4456 | 4460 | | |
4457 | | - | |
| 4461 | + | |
4458 | 4462 | | |
4459 | 4463 | | |
4460 | 4464 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments