Uh oh!
There was an error while loading. Please reload this page.
gh-141679: Add colour to defaults in argparse help - #141680
Conversation
argparse helpargparse help
savannahostrowski
left a comment
There was a problem hiding this comment.
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 |
Uh 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