Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-141679: Add colour to defaults in argparse help#141680
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
gh-141679: Add colour to defaults in argparse help #141680
Uh oh!
There was an error while loading. Please reload this page.
Conversation
hugovk commented Nov 17, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
argparse helpargparse help
savannahostrowski 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.
One comment about the two-color choice - I wonder if it might be a bit busy with the frequent color switching.
But overall, this looks really good and aligns with modern CLIs, IMO. I pretty extensively tested this and I couldn't find any issues. I also think it's fine to not apply color in help text when users might have literally written (default: ).
Uh oh!
There was an error while loading. Please reload this page.
mpkocher commented Nov 22, 2025
It would be useful to push these changes and then try to get as much feedback as possible before the 3.15 release. I agree that it does look a little too busy. I believe it would be good idea to make the Not sure if there was a follow up issue created from the "Open Issues" section of #133346 (specifically, clarifying how schema changes of a ThemeSection should be handled).
In [7]: from_colorizeimportget_themeIn [8]: t=get_theme().argparseIn [9]: t.actionOut[9]: '\x1b[1;32m'In [10]: t.default---------------------------------------------------------------------------AttributeErrorTraceback (mostrecentcalllast) CellIn[10], line1---->1t.defaultAttributeError: 'Argparse'objecthasnoattribute'default'In [11]: t.default_value---------------------------------------------------------------------------AttributeErrorTraceback (mostrecentcalllast) CellIn[11], line1---->1t.default_valueAttributeError: 'Argparse'objecthasnoattribute'default_value' |
hugovk commented Nov 22, 2025
When time allows, I think @ambv is planning on a PEP for adding a |
e73fbba into python:mainUh oh!
There was an error while loading. Please reload this page.
…1680) Co-authored-by: Savannah Ostrowski <savannah@python.org>
…1680) Co-authored-by: Savannah Ostrowski <savannah@python.org>
argparsehelp #141679