-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
gh-112527: Fix help text for required options in argparse #112528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…tter For actions with required=True, the ArgumentDefaultsHelpFormatter would always add a " (default: None)" to the end of the help text. Since that's a bit misleading, it is removed with this commit.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
I think it's minor enough to not require a news entry. Just let me know if you think otherwise. |
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your PR, @henzef, it looks interesting. Sorry that it took so much time to review it. Could you please add some tests?
|
And while this is not a major change, it fixes a weird behavior, and many users will be happy to hear this. This is why we have NEWS entries. |
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
I added unit tests and a news entry |
Misc/NEWS.d/next/Library/2025-12-09-14-40-45.gh-issue-112527.Tvf5Zk.rst
Outdated
Show resolved
Hide resolved
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 👍
|
Thanks @henzef for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
|
Sorry, @henzef and @serhiy-storchaka, I could not cleanly backport this to |
|
Sorry, @henzef and @serhiy-storchaka, I could not cleanly backport this to |
pythonGH-112528) For optional arguments with required=True, the ArgumentDefaultsHelpFormatter would always add a " (default: None)" to the end of the help text. Since that's a bit misleading, it is removed with this commit. (cherry picked from commit 1adb17b) Co-authored-by: Fabian Henze <[email protected]>
|
GH-142475 is a backport of this pull request to the 3.14 branch. |
pythonGH-112528) For optional arguments with required=True, the ArgumentDefaultsHelpFormatter would always add a " (default: None)" to the end of the help text. Since that's a bit misleading, it is removed with this commit. (cherry picked from commit 1adb17b) Co-authored-by: Fabian Henze <[email protected]>
|
GH-142477 is a backport of this pull request to the 3.13 branch. |
…112528) (GH-142475) For optional arguments with required=True, the ArgumentDefaultsHelpFormatter would always add a " (default: None)" to the end of the help text. Since that's a bit misleading, it is removed with this commit. (cherry picked from commit 1adb17b) Co-authored-by: Fabian Henze <[email protected]>
…112528) (GH-142477) For optional arguments with required=True, the ArgumentDefaultsHelpFormatter would always add a " (default: None)" to the end of the help text. Since that's a bit misleading, it is removed with this commit. (cherry picked from commit 1adb17b) Co-authored-by: Fabian Henze <[email protected]>
For actions with required=True, the ArgumentDefaultsHelpFormatter would always add a " (default: None)" to the end of the help text.
Since that's a bit misleading, it is removed with this commit.